Change Auto closure

Change Auto closure

This will be helpful in auto closing change request after X days it is in review stage. This use case is more suitable in environments where ONLY Requesters (customers) are the Change Reviewers and they want the Change to be closed if no review is done after 7 days. In these cases, customers wants this to be auto closed just like Request closing rules.

Kindly execute the below query and save it after running it under Reports->New Query Report. Feed this saved Query as Arguments under Admin->Custom schedule.

SELECT chdt.CHANGEID AS "change_id"  FROM ChangeDetails chdt LEFT JOIN Change_StageDefinition stageDef ON chdt.WFSTAGEID=stageDef.WFSTAGEID LEFT JOIN Change_StatusDefinition statusDef ON chdt.WFSTATUSID=statusDef.WFSTATUSID LEFT JOIN ChangeHistory cdh ON chdt.CHANGEID = cdh.CHANGEID LEFT JOIN ChangeHistoryDiff cdhd ON cdh.HISTORYID = cdhd.HISTORYID  where (stageDef.DISPLAYNAME = 'Review')  and  cdhd.COLUMNNAME in ( 'WFSTAGEID') and DATEDIFF(day, dateadd(s,datediff(s,GETUTCDATE() ,getdate()) +(operationtime/1000),'1970-01-01 00:00:00'),GETDATE()) > 2 group by chdt.CHANGEID

You can also verify the output of the query using the below query before scheduling.
 
SELECT chdt.CHANGEID AS "change_id", 
max(stageDef.DISPLAYNAME) AS "Stage", 
max(statusDef.STATUSDISPLAYNAME) AS "Status",
longtodate(max(operationtime)) "Operation time" FROM ChangeDetails chdt LEFT JOIN Change_StageDefinition stageDef ON chdt.WFSTAGEID=stageDef.WFSTAGEID LEFT JOIN Change_StatusDefinition statusDef ON chdt.WFSTATUSID=statusDef.WFSTATUSID LEFT JOIN ChangeHistory cdh ON chdt.CHANGEID = cdh.CHANGEID LEFT JOIN ChangeHistoryDiff cdhd ON cdh.HISTORYID = cdhd.HISTORYID  where (stageDef.DISPLAYNAME = 'Review')  and  cdhd.COLUMNNAME in ( 'WFSTAGEID') and 
 DATEDIFF(day, dateadd(s,datediff(s,GETUTCDATE() ,getdate()) +(operationtime/1000),'1970-01-01 00:00:00'),GETDATE()) > 2 group by chdt.CHANGEID

The script and Custom schedule config page reference are attached. By Default, scripts should be placed in [SDP MSP_Home]/integration/custom_scripts/ directory
      • Related Articles

      • Send Auto reminders to Change Approvers after X days

        Here is the script and kindly follow the steps below to achieve your requirement to send Auto reminders to Change Approvers after X days. For now, the script sends reminder for every 24 and 48 hours. This can be customized in the script. 1.Download ...
      • Script to Auto close Request when the status is set to Resolved

        This post describes the use of a python script to close requests that are set in Resolved status using Custom Schedules What is 'Custom Schedules' ? The Custom Schedules feature enables you to access any data in ServiceDesk Plus to perform customized ...
      • Auto Populate Scheduled Start Time and End Time in Change Request

        We can now auto-populate the Scheduled Start Time and End Time in a change request using FAFR. Under Admin>Change Template>Field and Form Rules, you can use the below scrips  Scheduled Start Time  var x=$CS.getValue("SCHEDULEDSTARTTIME"); if ( x ...
      • Script: Close associated changes when a request is closed

        Use case:  In many cases, the client never comes back to confirm the change. This means that the change remains opened indefinitely. When the ticket is closed it is logical that the change to be closed. No one is going to close a ticket unless the ...
      • Step to change the Session-Timeout (Auto Logout).

        Please follow the steps below and change the mentioned file. 1. Shut down the application. 2. Navigate into <Servicedeskplus-MSP> /conf directory. 3. Open the file web.xml in an editor. 4. Search for the following line : <session-config>         ...