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.
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):
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.