Highlighted
Absent Member.. Absent Member..
Absent Member..
430 views

ticket should close automatically after 30days from the day the status change to resolved

i want the incident ticket to close automatically after 30days from the day the status changes to resolved.

Please  help me with this

0 Likes
1 Reply
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: ticket should close automatically after 30days from the day the status change to resolved

We wrote a script in the ScriptLibrary to do this, except for 7 days.  And a scehdule record that kicks off every night to check if the Inicdent has been resolved for at least 7 days.  When the schedule record sees the incident has been resolved for 7 days then the script kicks in and closes the incident. 

So the schedule record on the javascript tab has this line to call the script:

system.library.AutoCloseIncident.AutoClose(7);

And then in Scriptlibrary we have a script called AutoCloseIncident that has this function:

function AutoCloseIM()
{
   var ticket = new SCFile("probsummary");
   var rc = ticket.doSelect("problem.status=\"Resolved\" and resolved.time<tod() - '7 00:00:00'");
     
   if (rc == RC_SUCCESS)
   {
      do {
          //ticket.resolution_code = "Automatically Closed";
                          ticket.doAction("close");
      } while (ticket.getNext() == RC_SUCCESS);
   }
}
AutoCloseIM();

*** If you do this, you will need to think about incident tasks.  I have another post from the past couple days where I talked about our incidents were able to be resolved with open tasks.  So here is another thread you may want to look at:

http://community.hpe.com/t5/Service-Manager-Service-Center/Process-Designer-question-for-Incidents/td-p/6881163

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.