I am updating a request and changing the site based on support group.
I don't see anything being run. Can't find error.
# This python script is used to change the Site value on a request o
import sys
import json
import datetime
# File containing request details will be stored as json object and the file path will be passed as argument to the script replacing the $COMPLETE_JSON_FILE argument
file_Path = sys.argv[1]
# Load the json content which contains request details
with open(file_Path) as data_file:
data = json.load(data_file)
requestObj = data['request']
# get the value for 'GROUP'
# set the additional field value to request due by time
setSite = requestObj["GROUP"]
# The return output should be in the below format
#{'operation': [{'OPERATIONNAME': 'EDIT_REQUEST', 'INPUT_DATA': [{'DUEBYTIME': '28 Jul 2016, 13:56:00'}]}], 'result': 'success', 'message': 'Sample Python script for updating request site'}
# Create json object which needs to be returned
detailsJSON1={}
detailsJSON1["SITE"]= setSite
resultjson={}
resultjson["result"] ="success"
# sample message to be returned
resultjson["message"] = "Python script executed for updating request due by time"
resultjson["operation"] = []
operationJson={"INPUT_DATA":[]}
operationJson["OPERATIONNAME"]="EDIT_REQUEST"
operationJson["INPUT_DATA"].append(detailsJSON1)
resultjson["operation"].append(operationJson)
# return the created json object
print(resultjson)