Custom Field: Reopen Counter

General discussion about MantisBT Plugins

Moderators: Contributor, Developer

Post Reply
chnbcln
Posts: 4
Joined: Oct 04, 2018 2:42 am

Custom Field: Reopen Counter

Post by chnbcln » Jan 08, 2019 8:58 pm

Good Day!

I just want to ask for your help if there's anyway to create a custom field to count how many times that the ticket has been reopen. I just need it for my reports.

Thank you in advance for your kind assistance.

cas
Posts: 483
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Custom Field: Reopen Counter

Post by cas » Jan 09, 2019 3:47 am

You can find all the various status changes in the history table, that will give you what you need.

chnbcln
Posts: 4
Joined: Oct 04, 2018 2:42 am

Re: Custom Field: Reopen Counter

Post by chnbcln » Jan 09, 2019 9:19 pm

Good day, yes. But the thing is i need the total reopen status per ticket for our team's report. Is there any way to have a custom field that query it to get the total reopen count per ticket so I can add it to the excel report?

cas
Posts: 483
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Custom Field: Reopen Counter

Post by cas » Jan 10, 2019 5:29 am

No, there is no such option available for a customfield. You could include phpexcel (or nowadays phpspreadsheet) into the application. This will allow you to make your own reports based upon your own selected subset of data (including various calculations)

Starbuck
Posts: 168
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: Custom Field: Reopen Counter

Post by Starbuck » Jan 14, 2019 5:03 pm

I think what you want is a trigger so that when a ticket is changed from Resolved/Closed status to anything else, that the value of a custom field is incremented. Is that a focused description of this challenge?

I think we can refine that further, that it sounds like you'd like a plugin which will change the value of a custom field in some way on any specific status change. Is that correct?

So we're looking for logic like this (made up pseudo-code) :

Code: Select all

if(original_status != current_status) { triggerEvent("STATUS_CHANGE"); }
...
  handleStatusChange(old,new) {
    if( old == STATUS_CLOSED ) { 
       if (new == STATUS_IN_PROGRESS || new == STATUS_FEEDBACK || new == something_interesting ) {
           custom_values( MY_VALUE ) = something_different
       }
    }
  }

If that's a good summary of the challenge, then here's how we go about responding to the challenge. We need to understand how triggers work and how to create a plugin that handles an event like this. We're looking for an event that occurs when an existing item is filed, and/or when a field changes. Then we need to know how to create a plugin to handle that event, to receive the values that we need to make decisions, and to return a new custom value.

If that sounds like a plan, then I suggest you look at existing plugins that do something similar: When field X is "foo" we want to set field Y to be "bar". We can then adapt that code to do what is desired here.

I look forward to your responses.

If your response is "but I don't code", then that is another challenge that needs to be solved. Please look at prior notes I've posted here about how to solve That problem.

HTH
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!

Post Reply