How to create a change automatically based on a schedule

How to create a change automatically based on a schedule

This is a sample python script that triggers the creation of a Change Request in ServiceDesk Plus using the Change API based on a schedule

Note:  Attached script will not work beyond 11138 SDP Version.

A short guide on setting up python is available here.

Execution steps:

1. Download the attached zip
2. Move create_change.py, configuration.json, functions.py, change.json files to sdp_home/integration/custom_scripts folder
(Note Don't move configuration.json if the same file exists in that location)
3. Edit change.json and update the highlighted fields, You can add/remove more fields based on your requirement, Check here for supported fields


[
{
    "operation": {
        "details": {
            "title": "Tiltle of the change",
            "technician": "administrator",
            "stagename": "submission",
            "statusname": "Requested For Information",
            "statuscomments": "Comments for status",
            "priority": "high",
            "templatename":"General Template",
            "description": "description of the change",
            "servicesaffected ": [
                "email",
                "hardware"
            ]
        }
    }
}
]

4. If you want to create multiple change requests at the same time just add one more change object to the existing one

[
{
    "operation": {
        "details": {
            "title": "Tiltle of the change",
            "technician": "administrator",
            "stagename": "submission",
            "statusname": "Requested For Information",
            "statuscomments": "Comments for status",
            "priority": "high",
"templatename":"General Template",
            "description": "description of the change",
            "servicesaffected ": [
                "email",
                "hardware"
            ]
        }
    }
},
{
    "operation": {
        "details": {
            "title": "Tiltle of the change",
            "technician": "administrator",
            "stagename": "submission",
            "statusname": "Requested For Information",
            "statuscomments": "Comments for status",
            "priority": "high",
             "templatename":"General Template",
            "description": "description of the change",
            "servicesaffected ": [
                "email",
                "hardware"
            ]
        }
    }
}

]

Note: You can add any number of change objects based on your requirement

5. Edit configuration.json and update url and technicianKey (Check here for API key generation )
6. Now go to Admin --> Custom Schedules --> Create a new schedule as shown below



                  New to ADSelfService Plus?

                    • Related Articles

                    • 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 ...
                    • How to automatically create a project and associate it to a change using change custom triggers.

                      This script is applicable only for builds prior to 11138. This post describes the use of a sample python script you to create a Project automatically from a Change request and create a association between them.This script can be configured under ...
                    • 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 ...
                    • Risk Matrix for Change using Custom Module

                      Overview: A risk matrix helps in identifying risks based on how likely they are to happen and how serious their impact could be. This makes it easier to decide which risks need urgent attention and which ones can be watched over time. It helps manage ...
                    • Script to add worklog using custom schedule

                      What is a Custom Schedule? Custom Schedules are actions scheduled on a specific date and time with or without repeat frequency. The actions are specified in a customized script file. Any data from ServiceDesk Plus can be sent to the script through ...