Application of ServiceDesk plus ticket API
Convert mail to service class
In event management, SDP can quickly establish incident ticket through the web, mail, etc., but the function of creating work order by mail, cannot use the service catalog template, cannot implement approval process. This article will show you how to convert your received mail ticket to a service ticket in SDP to meet the needs of business, process, and compliance management.
SDP: Recommended upgrade to latest version
Operating systems: Deploying the Python Runtime environment, and the requests library
The SDP provides a richer API interface to perform operations such as work order creation, update, and deletion through its interface program, and we use its API interface, in Python language, to write a script that enables the SDP to receive the mail ticket, identify the service through keywords such as a subject, Create the corresponding service ticket in the SDP through its API and delete the original mail ticket.
With regard to scripting calls, the SDP provides the ability to customize triggers that trigger and execute scripts when work orders are created and edited.
Deploying a Python environment
Configure the Python environment on the SDP server to enable the SDP to execute Python scripts.
1. Download and install Python 3.4.1 or later
- Configure the environment variables to confirm that the Python installation directory has been added to the path variable. For example, Python is installed on the server? C:\PYTHON34, ensure that the following path is added to the path:
After this step is complete, the command prompt (CMD) should be able to execute "Python" or "Py" instructions.
3.? The request to process the API in Python requires a call to the requests library, which is not bound to the Python installation package and needs to be deployed separately.
Installing the Requests Library
1.? CMD, CD to the Python installation directory under the Scripts folder, and then perform PIP install requests
- When you see the following prompt, the deployment succeeds:
3.? Enter Python and enter import requests, if no error is returned, indicating that the requests library has been successfully loaded
Configuring in the SDP
Note: Refer to the SDP Knowledge Base for a Python script:
1.? Edit the Python script and place the script file in the following directory in the SDP: \manageengine\servicedesk\integration directory\custom_scripts.
2.? Follow the prompts to modify the script content. Update the app's login address and the SDP's Technicankey (available on the technician's personalization page), as shown in:
3.? In the SDP, "management--help desk customizer-and custom Trigger" is set, as shown, set the match condition as the subject contains "request", execute the action to set the Python script, complete the save.
4.? Now send a message with the word "request" to the incoming mail server set up in the SDP to automatically convert the generated ticket to the corresponding service ticket.
ServiceDesk Plus ticket API app------convert mail to service class