Closed Change Tickets are still showing as active.

prash4
Tera Expert

We have 54 Change tickets that are in a Closed State but are still Active.  How can we get this corrected  ? 

7 REPLIES 7

sonali panda1
Kilo Sage

Hi,

You can run a background script to make them inactive. Or just in list view have a bulk edit to inactivate them. It may trigger some business rules which are on inactivating the records. If thats not needed then a background script with setWorkflow(false) can be executed. 

Apart from this, you will need to check why the closed records are still active. Is it happening for new records also that you close or they are just some history records which are like that. But figuring out the cause will help you to ensure that it dont happen again.

Musab Rasheed
Tera Sage
Tera Sage

Hi,

Write a fix script to correct this, Make sure you run this in lower environment before running in Prod

var count=0;
var gr = new GlideRecord('change_request');
gr.addQuery('state', 'closed');
gr.addQuery('active', 'true');
gr.query();
while(gr.next())
{
count++;
gr.active = 'false'
gr.setWorkflow(false);
gr.update();
}
gs.print("Number of closed changes are ", count);
Please hit like and mark my response as correct if that helps
Regards,
Musab

Viraj Hudlikar
Giga Sage

Is it happening for all Change Requests or particular Change Requests?

Please check the BR "Close Ticket" on the change_request table is the condition getting satisfied? Has it been modified by someone?

And to mark this identified Change request you can write a fixed script and run it and update the active field to false and yes try to run the script first in non-prod so have that confidence to run in PROD. 

Hi Viraj,

how to identify the cause for this ? could you please help me on this.