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

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