Since i see a lot of admins having trouble making this work, i am posting a walkthrough i made with a working python script.
How to add approval workflow on a request in SDP & SDP MSP
with automatic approval send, using python
Warning : This procedure works only for requests created through ServiceDesk portal. This will not work with email fetching.
Step 1:
Install python on the server that SDP or SDP MSP is running. On installation procedure select to add the PATH as well.
Python version that was used for testing purposes was 3.5.1 (32bit).
Step 2:
Download approval.py provided in the zip attached on this post and save it in
C:\ManageEngine\ServiceDeskPlus-MSP\integration\custom_scripts
Or
C:\ManageEngine\ServiceDeskPlus\integration\custom_scripts
Depending on your product.
Step 3: (Optional)
If you want to use the $reporting_to version of the script then you have to fill in the field “Reporting to” on the requesters details. Otherwise edit the script and provide a fixed email address in the field on line 31.
Step 4:
Time to create the trigger.
This can be done in admin/custom triggers tab.
Add new action.
Give it a name and description, choose for which accounts it will be applied (MSP) and when it will be executed.
Match whatever criteria you want for it to be triggered.
Finally add the action to be taken.
In this case the action is “Execute script” and in the field to be run enter (in a continues line):
cmd /c C:\Users\mml\AppData\Local\Programs\Python\Python35-32\python.exe C:\ManageEngine\ServiceDeskPlus-MSP\integration\custom_scripts\approval.py $COMPLETE_JSON_FILE
!!! Change the red text accordingly. !!!
Attention - Depending on how you have installed Python on your server and if you added the paths or not during installation you may find that using the absolute paths above that i have used (installed as a user) may not work for you. In that case try this in the execute script path field (don't use the quotes) "py approval.py $COMPLETE_JSON_FILE"
After a successful test, you should see the result given back by json in the history tab of a request using the trigger.
After a refresh you should see the approval tab in the request as well.
Enjoy!
Mikallos Loizos
Technical Department