Script Master - 11: How to automatically create multiple child requests from a parent request with a configurable JSON file.

Script Master - 11: How to automatically create multiple child requests from a parent request with a configurable JSON file.

Greetings to you, users!

 

This Script Master's post will help you learn how to automatically trigger the creation of multiple child requests from a parent request, based on the request template chosen. Also the request ID of the child requests are added as notes to the parent request.

  

This is achieved  using an API call to create a request in ServiceDesk Plus. Details of the child requests are stored in a json file and provided as input to the API call. A separate API call is made to add notes to the parent requestRefer the comments within the script for more information on the json structure and tips to write the script. The script to do this is available here.


The configurable JSON file contains the name of the request template, of the parent request and the list of child requests to be created. The script matches the template's name received from the parent request against the name in the JSON file and creates child requests accordingly.


Execution steps:


1. Copy the script and configuration file into the \Manageengine\ServiceDesk\integration directory.

 

2. Update the script with the help of the comments provided within.

 

3. Configure the input JSON file with the help of the detailed explanation in the resources post.

 

4.Configure the script under the  Admin  ->  Custom Triggers. Provide path of the JSON  file that contains the request configuration as the first parameter to the script. Let the second parameter be the name of the request JSON file.


I've attached a screenshot showing a sample implementation below.




Note:

 

1. This script was tested on python v3.4.1 - 32 bit.

2. You can use this script in any version of ServiceDesk Plus above 9039.

3. A python library called 'Requests' is necessary to run this script on the application server.

 

To make the best use of this, take a look at the comments within the script and the related post in our resources section.


Trust you find this post useful. In case you've missed the previous posts, visit here. Read through them and post your feedback as comments on the respective posts.

                  New to ADSelfService Plus?