How to Automatically Associate a Ticket to a Project using PrjID based on Ticket Template

How to Automatically Associate a Ticket to a Project using PrjID based on Ticket Template

This post describes the use of a sample python script you to associate a Project automatically to a ticket during its creation/edit based on conditions, such as template matching. This script can be configured under Custom Triggers and you will find more information about this here. This is achieved using a v3 API call to in ServiceDesk Plus and therefore it is essential to check if the end user's build supports API v3. The required customization is to be performed in the first section of the script. And the $COMPLETE_V3_JSON_FILE is the argument to the script.

Use Case: The discussed scenario for which this script was requested is that the Customer has an ongoing project and whenever an incident is raised with reference to that Project, it must automatically get assigned to the Project based on a condition. The template was a condition, however, it can be modified to any additional field as well.
As of this script, the Project ID is hardcoded but can be made to be fetched based on criteria as well.

Execution Steps:
1. Download and copy the script file into the \Manageengine\ServiceDesk\integration\custom_triggers directory.

2. Update the protocol, servername and portnumber used to access ServiceDesk and the technician api key in the configuration.json.

3. Configure the script under the  Admin  ->  Custom Triggers, like shown below.



A short guide on setting up python is available here.

                    New to ADSelfService Plus?

                      • Related Articles

                      • 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 ...
                      • Risk Matrix for Change using Custom Module

                        PURPOSE: Creating Risk matrix for changes that automatically calculates the risk of a change based on its priority and impact. Similar to the Priority matrix in the request module. TESTED IN BUILDS: 14504 STEPS: Step 1: Configure the Custom Module: ...
                      • Notification script using Custom function in custom trigger

                        This is applicable from 10600 builds. From 10600 , Business rules dont have Email notification feature. The same use case be achieved through Custom triggers feature as mentioned below. Script to enable notification of request creation using custom ...
                      • Set SLA automatically for a service request using FAFR

                        Note: The below FAFR script will work only on 10600 MSP and above Requirement: Set SLA automatically for a service request depending on the Priority. Usecase: Let us consider a scenario where SLA has to be set depending on the requester's associated ...
                      • Technician notification based on the site

                        This KB will help you to get the notification about based on the site to a technician. Please follow the below instructions. Please navigate to Admin >> Request timer action >> Add new timer action. Please configure the below in the application. ...