Custom Field: Reopen Counter

General discussion about MantisBT Plugins

Moderators: Developer, Contributor

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

Custom Field: Reopen Counter

Post by chnbcln »

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: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Custom Field: Reopen Counter

Post by cas »

You can find all the various status changes in the history table, that will give you what you need.
chnbcln
Posts: 4
Joined: 04 Oct 2018, 07:42

Re: Custom Field: Reopen Counter

Post by chnbcln »

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: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Custom Field: Reopen Counter

Post by cas »

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: 219
Joined: 14 Feb 2006, 02:53
Location: USA
Contact:

Re: Custom Field: Reopen Counter

Post by Starbuck »

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