Close parent request only if all the linked request are closed.

Close parent request only if all the linked request are closed.

Requirement:
Parent ticket can be closed only if all the linked requests are closed

Usecase:
In many organizations, the parent ticket is divided into many sub-requests, each of which is handled by a different technician/group.
All of these sub-requests are linked to a single-parent ticket.  This parent ticket should not be closed until all linked requests have been resolved.

Steps to configure:
1.  Download the attached scripts.  Copy the contents into Request custom functions.

2.  Goto Admin > Request Custom Function > Global Function > New > Paste the global function contents and save it with a name.
Update the URL and integration/technician key in the script. 
  1. For builds over 11300, 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. For builds prior to 11300, refer https://help.servicedeskplus.com/api/rest-api.html$key and update the technician key.

3.  Goto Admin > Request Custom Function > Custom Function > New > Paste the CloseParent_only_if_all_the_linked_requests_are_close.txt content and save it with a name
Update the global function count according to your instance

4.  Configure the created custom function in a Business Rule to get executed every time a request is close.




                  New to ADSelfService Plus?

                    • Related Articles

                    • How to close linked requests when a parent request is closed.

                      This post describes the use of a python script to close all the linked request when a parent request is closed using custom triggers. Use Case: We get tickets which are getting reported for the same issue but different end-users so that once we ...
                    • Linked request

                      This report is used to find the child request id that are linked to the parent request id.  To make any changes to a query, refer to the KB article below. ...
                    • Close all linked requests when a parent request is closed - Deluge

                      Requirement: All the linked requests need to be closed when the parent request is closed. Refer to this link for Python equivalent:  https://pitstop.manageengine.com/portal/en/kb/articles/how-to-close-linked-requests-when-a-parent-request-is-closed ...
                    • 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 ...
                    • Query to show parent and child requests (Linked Request) and its details.(MSSQL & PGSQL)

                      Tested in Build PGSQL (14300) or MSSQL (14306) Please go to Reports-New Query Report and execute this query. select woparent.WORKORDERID "Parent request ID", aaauparentreq.first_name "Parent Requester", woparent.title "Parent Subject", ...