How to automatically create a task in a Change Request.

How to automatically create a task in a Change Request.

This is a sample script to create a task in a Change Request based on the values given in certain fields. This is done by using an API call to create  a task in ServiceDesk Plus. The task can also be created in a request, problem, project or a milestone. The type and ID of the entity the task is associated to , has to be specified in the json input that is given in the script.

Below is the json format for adding a Task.

{"task": {  "title": "Update SDPLIVEHELP","description": "Content consolidation","status": {"name": "Open"},"change": {"id": "7"}}

The highlighted parameter can be changed as  , "request": {"id": "7"} , to create a task for a request with the ID 7.

You will find the script file named CreateTask.py and a screenshot showing the Custom Trigger configuration attached below.For more information on the API for task related operations , please go to Admin Tab --> API --> Documentation in ServiceDesk Plus.

UseCase:
Let's imagine you are about to install the latest patch update in all the workstations of your IT infrastructure. A change request with a task but without a foolproof plan and implementation strategy will make the change manager's job tough, especially when you have different flavors of workstations like Windows, Linux etc.So this Script will help you learn to create a task in a changerequest based on the given values in certain fields.

A short guide on setting up python is available here.

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 -> Change Custom Triggers. Provide the path of the change  json file as the input to the script.

Below is a screenshot showing a sample configuration.



‚Äč