Not able to resolve incident using restapi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 02:02 PM
Hi ,
I m trying to resolve an incident using restapi. This is what I have done.
1) via rest api I have populated every field it needs for resolving an incident. (in my pay load I m not settings State : 6 . I have another request for resolving incident)
2) At this moment I can go in SNOW url , open my incident and if I click resolve button , incident goes in resolved state.
3) if I do step 1 again and then submit another rest api pay load which ONLY has {"state":6} it should move incident in Resolved state right ? even though I get error 200 in my response , I still do not see ticket in resolved state
4) why the State field is not updating when using RestAPI ?
what am I missing ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 02:25 PM
Thanks Rajesh,
Can you please share the result of this POST request ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 02:33 PM
My SNOW admin has left for that day. I will update tomorrow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 02:40 PM
I will try to send in few. but I did take look at Resolve button java script. its default code and we haven't changed anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 02:49 PM
so i created an incident.
then i did GET in sysid
then i did PUT my payload is
{"state":6,"urgency":3,"assigned_to": "Rajesh Solanki", "close_code":"Solved", "caller_id":"e2ebef694fb1b200571150ee0310c70e", "u_close_subcode":"Permanent","close_notes":"Auto Closed by postman","work_notes":"Alert deleted by postman"}
here is reply.
{
"result": {
"parent": "",
"caused_by": "",
"watch_list": "",
"upon_reject": "cancel",
"sys_updated_on": "2017-06-01 21:41:31",
"u_close_subcode": "Permanent",
"approval_history": "",
"skills": "",
"u_reported_by": {
"link": "https://myservicenow.com/api/now/v1/table/sys_user/e2ebef694fb1b200571150ee0310c70e",
"value": "e2ebef694fb1b200571150ee0310c70e"
},
"number": "XXXXXXXXXX",
"state": "21",
"sys_created_by": "restapi",
"knowledge": "false",
"order": "",
"u_sla_responded": "true",
"cmdb_ci": {
"link": "https://myservicenow.com/api/now/v1/table/cmdb_ci/e736a1eb4f439600571150ee0310c761",
"value": "e736a1eb4f439600571150ee0310c761"
},
"impact": "1",
"u_outage_content": "",
"active": "true",
"work_notes_list": "",
"u_vendor": "",
"priority": "3",
"sys_domain_path": "/",
"business_duration": "",
"group_list": "",
"approval_set": "",
"short_description": "Critical alert on Server XXXXXXX for directory /tmp. Space used 100%",
"correlation_display": "",
"work_start": "",
"u_manager_notification": "",
"additional_assignee_list": "",
"u_requestor": "",
"u_originating_ticket": "",
"notify": "1",
"sys_class_name": "incident",
"closed_by": "",
"follow_up": "",
"parent_incident": "",
"reassignment_count": "0",
"assigned_to": "",
"sla_due": "",
"comments_and_work_notes": "",
"escalation": "0",
"upon_approval": "proceed",
"correlation_id": "XXXX_XXXXX/XXXXXX",
"made_sla": "true",
"child_incidents": "0",
"resolved_by": "",
"sys_updated_by": "restapi",
"opened_by": {
"link": "https://myservicenow.com/api/now/v1/table/sys_user/e2ebef694fb1b200571150ee0310c70e",
"value": "e2ebef694fb1b200571150ee0310c70e"
},
"user_input": "",
"sys_created_on": "2017-06-01 21:29:28",
"sys_domain": {
"link": "https://myservicenow.com/api/now/v1/table/sys_user_group/global",
"value": "global"
},
"u_hpsm_change_number": "",
"calendar_stc": "",
"closed_at": "",
"u_alternate_contact": "",
"business_service": "",
"u_symptom": "degraded",
"rfc": "",
"time_worked": "",
"expected_start": "",
"opened_at": "2017-06-01 21:28:20",
"work_end": "",
"caller_id": {
"link": "https://myservicenow.com/api/now/v1/table/sys_user/e2ebef694fb1b200571150ee0310c70e",
"value": "e2ebef694fb1b200571150ee0310c70e"
},
"resolved_at": "",
"subcategory": "Server",
"work_notes": "",
"u_substate": "",
"close_code": "Solved",
"assignment_group": {
"link": "https://myservicenow.com/api/now/v1/table/sys_user_group/da4485ca4fd65640571150ee0310c75e",
"value": "da4485ca4fd65640571150ee0310c75e"
},
"u_kb_article": "",
"business_stc": "",
"description": "Critical alert on Server XXXXXXX for directory /tmp. Space used 100%",
"u_outage_title": "",
"u_vendor_ticket": "",
"calendar_duration": "",
"close_notes": "Auto Closed by restapipostman",
"u_customer_name": "RESTAPI RESTAPI",
"sys_id": "f42c66524f0b3640571150ee0310c71a",
"contact_type": "event_alert",
"incident_state": "6",
"urgency": "3",
"problem_id": "",
"company": "",
"activity_due": "",
"severity": "3",
"u_search": "",
"comments": "",
"approval": "not requested",
"u_first_call": "false",
"due_date": "",
"sys_mod_count": "1",
"reopen_count": "0",
"sys_tags": "",
"u_broadcast_notification": "",
"location": "",
"category": "Servers & Storage"
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 03:07 PM