Hello,
when receiving the resulting JSON back from service-now the following error shows up:
2017-10-02 11:48:48 SEVERE [ServiceNowAction@6184018b-2b67-4731-8b76-d4de3c720f89] org.json.JSONException: JSONObject["result"] is not a JSONObject.
at org.json.JSONObject.getJSONObject(JSONObject.java:557)
at com.dynatrace.plugin.ServiceNowAction.execute(ServiceNowAction.java:262)
at com.dynatrace.diagnostics.sdk.UserPluginManager.a(SourceFile:770)
at com.dynatrace.diagnostics.sdk.UserPluginManager.b(SourceFile:480)
at com.dynatrace.diagnostics.sdk.UserPluginManager.a(SourceFile:337)
at com.dynatrace.diagnostics.sdk.UserPluginManager.a(SourceFile:319)
at com.dynatrace.diagnostics.sdk.UserPluginManager.executePlugin(SourceFile:270)
at com.dynatrace.diagnostics.sdk.ActionPluginExecutor.execute(SourceFile:31)
at com.dynatrace.diagnostics.sdk.ActionPluginExecutor.execute(SourceFile:13)
at com.dynatrace.diagnostics.schedule.ServerJobCenterRegistry.a(SourceFile:190)
at com.dynatrace.diagnostics.schedule.ServerJobCenterRegistry.a(SourceFile:413)
at com.dynatrace.diagnostics.schedule.ServerJobCenterRegistry.execute(SourceFile:337)
at com.dynatrace.diagnostics.schedule.SchedulerJob.a(SourceFile:101)
at com.dynatrace.diagnostics.schedule.SchedulerJob.work(SourceFile:92)
at com.dynatrace.diagnostics.schedule.SchedulerJob.executeJobInfo(SourceFile:241)
at com.dynatrace.diagnostics.schedule.QuartzJob.execute(SourceFile:45)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at com.dynatrace.diagnostics.schedule.QuartzThreadPool$WorkerThread.run(SourceFile:788)
The result JSON looks like:
{
"result": {
"parent": "",
"made_sla": "true",
"caused_by": "",
"watch_list": "",
"upon_reject": "cancel",
"sys_updated_on": "2017-10-02 11:36:53",
"child_incidents": "0",
"hold_reason": "",
"approval_history": "",
"number": "INC0010004",
"resolved_by": "",
"sys_updated_by": "admin",
"opened_by": {
"link": "https://dev43523.service-now.com/api/now/v2/table/sys_user/6816f79cc0a8016401c5a33be04be441",
"value": "6816f79cc0a8016401c5a33be04be441"
},
"user_input": "",
"sys_created_on": "2017-10-02 11:35:22",
"sys_domain": {
"link": "https://dev43523.service-now.com/api/now/v2/table/sys_user_group/global",
"value": "global"
},
"state": "1",
"sys_created_by": "admin",
"knowledge": "false",
"order": "",
"calendar_stc": "",
"closed_at": "",
"cmdb_ci": "",
"delivery_plan": "",
"impact": "3",
"active": "true",
"work_notes_list": "",
"business_service": "",
"priority": "5",
"sys_domain_path": "/",
"rfc": "",
"time_worked": "",
"expected_start": "",
"opened_at": "2017-10-02 11:35:22",
"business_duration": "",
"group_list": "",
"work_end": "",
"caller_id": "",
"resolved_at": "",
"approval_set": "",
"subcategory": "",
"work_notes": "",
"short_description": "Test incident creation through REST Updated",
"close_code": "",
"correlation_display": "",
"delivery_task": "",
"work_start": "",
"assignment_group": "",
"additional_assignee_list": "",
"business_stc": "",
"description": "",
"calendar_duration": "",
"close_notes": "",
"notify": "1",
"sys_class_name": "incident",
"closed_by": "",
"follow_up": "",
"parent_incident": "",
"sys_id": "a1bf35714f210300fe9db5e18110c7cf",
"contact_type": "",
"incident_state": "1",
"urgency": "3",
"problem_id": "",
"company": "",
"reassignment_count": "0",
"activity_due": "",
"assigned_to": "",
"severity": "3",
"comments": "",
"approval": "not requested",
"sla_due": "",
"comments_and_work_notes": "",
"due_date": "",
"sys_mod_count": "3",
"reopen_count": "0",
"sys_tags": "",
"escalation": "0",
"upon_approval": "proceed",
"correlation_id": "",
"location": "",
"category": "inquiry"
}
}