Script Master - 7: How to create a new change request automatically from a parent request.

Script Master - 7: How to create a new change request automatically from a parent request.

Hello users,

 

Today's Script Master's post will help you to trigger the creation of a change request using a API call,based on the values in certain fields of the parent request.The request ID of the parent request is appended  to the subject line of the change request.

 

Refer to the comments within the script for more information on the json structure in which data has to be send in the API call for creating a change request.The script to do this is available here.

 

Let us assume a scenario where a  requester needs to create a change request.This requirement may not warrant a change in their role to a technician with access to the Change module.Therefore create a request template with the value in the Request type field as "May need a CR".This is used to trigger the creation of a new change request.


Execution steps:

 

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

 

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

 

3. Configure the script under the Admin -> Custom Triggers. Provide the path of the request json file as the input to the script.

 

Below is a screenshot showing a sample configuration.




Note:

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

2. 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 in 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 send your feedback to us as comments onto the respective posts. See you next Wednesday with another useful script.

                New to ADManager Plus?

                  New to ADSelfService Plus?