How to close Work Order using REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2017 03:59 AM
Hello.
I'm trying to close work order via REST API explorer (for testing) .
Using dedicated user for that. With all the roles (admin). Work orders are created with that user also.
I try to use these fields in PUT request to wm_order table:
{"work_notes":"test","state":"3","u_close_code":"1"}
PUT https://instance.com/api/now/table/wm_order/HereIsSysId
I get 200 OK.
The problem is that everything updates but state.
I can't change it at all via PUT. Other fields like close notes modified just fine.
What should i look into?
UPDATE: Work Order Tasks doesnt update State as well with PUT
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2017 04:26 AM
Well, you can try to close it in background scripts with setWorkflow(false). If you can close it there, you can close it in Scripted REST. I don't know all the relationship roadblocks between the two records, and I certainly don't know your own instance, but there has to be a way to do it via script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2020 09:36 AM
Hi
I'm having the same issue, it might be because of the state flows. Is there anyway we can change the state through API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 02:06 AM
@meghanareddy206@gmail, are you able to figure it out? Guess the state is control by the state flow. Couldn't get pass this by using Put in REST API. The work notes is empty even though I passed in the work notes in the request body