Close all the associated requests when a change is closed

Close all the associated requests when a change is closed

Requirement:
When a change is closed, all the associated requests have to be closed. 
This includes both:
  1. Change initiated due to request
  2. Request caused by change

Steps to configure:
  1. Goto Admin > Developer Space > Global function > New > Paste the content from the attachment  Global function_4.txt  and save it with a name.
  2. Update the URL and integration key in the script. 
    1. You can get the integration key under Admin > Integrations > Integration Key > New
    2. Please use an integration key with admin privilege, as there wont be any role related permission issues. 

    3. Update the integration key in the global function.



Change initiated due to request:
Steps to configure:
  1. Go to Admin > Developer Space > Change Custom Functions. Create a new function. Paste the content of "close_request_change_initiated_due_request.txt".
  2. Update the global function count/api name in the custom function.

  3. Configure a custom trigger to invoke the custom function, every time a change is closed.



    Request caused by Change:

    Steps to configure:
    1. Go to Admin > Developer Space > Change Custom Functions. Create a new function. Paste the content of "Close_Request_caused_by_Change.txt".
    2. Update the global function count/api name in the custom function.
    3. Configure a custom trigger to invoke the custom function, every time a change is closed.



                      New to ADSelfService Plus?

                        • Related Articles

                        • How to close associated incident requests of change request automatically

                          This post describes the use of a python script to close change that are in a specific stage using Custom Schedules. Use Case: There may be a scenario where number of Change Requests that have got closed and the associated incident is still in open ...
                        • 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 ...
                        • Close change requests using custom schedules.

                          This post describes the use of a python script to close change that are in a specific stage using Custom Schedules.   Use Case: There may be a scenario where number of old Change Requests that have gotten lost in the shuffle over the years. Most of ...
                        • Query to show Problems, its associated incidents and change_ (MSSQL)

                          Tested in Build MSSQL (14306) SELECT woproblem.PROBLEMID AS "Problem ID", woproblem.TITLE AS "Problem Title", "priodef"."PRIORITYNAME" AS "Problem Priority", "urgdef"."NAME" AS "Problem Urgency", "statdef"."STATUSNAME" AS "Problem Status", ...
                        • Query to get all the requests associated to a change (MSSQL & PGSQL)

                          Tested in builds PGSQL (14300) or MSSQL (14306) Postgres Query: select chd.ChangeID "Change ID", chd.title "Change name", wo.workorderid "Request ID", wo.title "Request Subject" from incidentcausedbychange incach left join ChangeDetails chd on ...