I need to access the data in the request, to process it through an external script, this is working but not sending all the data.
The custom trigger is executing the external script properly.
Below I have included the script and the log file it generates. As you can see it dumps the names of the custom fields but not the values.
Any help with this issue is appreciated.
Thanks
Sal
ServiceDesk Plus version: 9.2 9208
Custom trigger "Execute script": python get_ticket_data.py $COMPLETE_JSON_FILE
Script: get_ticket_data.py
import sys
import json
import logging
logfile = open('d:/Logs/CecdesScripts.log','w+')
filepath = str(sys.argv[1])
with open(filepath) as data_file:
data = json.load(data_file)
json.dump(data, logfile, indent=4)
logfile.close()
Data dump of JSON file
{
"request": {
"SITE": "",
"CREATEDTIME": "1460674492577",
"TIMESPENTONREQ": "0hrs 0min",
"SHORTDESCRIPTION": "Please provide the services required for our new employee",
"EDITORID": "null",
"EDITING_STATUS": "0",
"REQUESTTEMPLATE": "Employee new hire",
"RESPONDEDTIME": "0",
"ASSET": "",
"APPROVAL_STATUS": "",
"ISVIPUSER": "No",
"resource": {
"Employee information:": {
"New Company": [],
"Employee Name": [],
"What is the seating location?": [],
"Employee title ?": [],
"After hours access to office": [],
"Office location": [],
"Start Date:": [],
"Manager Name:": [],
"New Department": []
},
"Hardware:": {
"Is a company phone required?": [],
"Computer": []
},
"Network Access": {
"Check the drive mappings the user will require": []
},
"Software:": {
"Additional Access (we should add these to the favorites is a standard)": [],
"Additional apps:": []
},
"Software": {
"Choose software": []
},
"Folder Access": {
"Please list any folders the user requires access to": []
},
"Printers": {
"What printers need to be installed for the user": []
},
"Distribution Lists": {
"Please enter the names of any distribution lists the user will need to be added to": []
}
},
"IS_CATALOG_TEMPLATE": "true",
"REQUESTER": "*****",
"RESOLVEDTIME": "0",
"CLOSURECODE": "",
"STATUS": "Open",
"SUBCATEGORY": "New Hire",
"DESCRIPTION": "Please provide the services required for our new employee",
"FCR": "false",
"ITEM": "test_script",
"GROUP": "",
"DUEBYTIME": "-1",
"LOGIN_NAME": "*****",
"CATEGORY": "Human Resources",
"COMPLETEDTIME": "0",
"CREATEDBY": "*****",
"SUBJECT": "Employee new hire script test",
"SLA": "",
"YETTOREPLYCOUNT": "",
"LOGGEDIN_USER_NAME": "*****",
"CLOSURECOMMENTS": "",
"WORKORDERID": "1914",
"DEPARTMENT": "IR-System Infrastructure",
"Employee Name": "test user"
}
}