Page 1 of 1

Custom Field: Reopen Counter

Posted: 09 Jan 2019, 01:58
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.

Re: Custom Field: Reopen Counter

Posted: 09 Jan 2019, 08:47
by cas
You can find all the various status changes in the history table, that will give you what you need.

Re: Custom Field: Reopen Counter

Posted: 10 Jan 2019, 02:19
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?

Re: Custom Field: Reopen Counter

Posted: 10 Jan 2019, 10:29
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)

Re: Custom Field: Reopen Counter

Posted: 14 Jan 2019, 22:03
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