Closing out an issue using the table REST api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 04:56 PM
Hello all, I have been trying to close out / resolve an issue using the rest table api.
when I send the patch request I am able to create, and update an issue
resolve = \
{
"caller": "admin",
"resolution_code": "2",
"incident_state": "2",
"close_code": "2",
"resolution_notes": "resolved-test",
"close_notes": "resolved-test",
"resolved_by": "admin",
"resolved_at": str(datetime.datetime.now()),
}
Sending this updates the closed notes, resolution notes, etc.
But when I try to send it with a resolution code 6 or 7 to set it to closed,
I get the following error:
```
'error': {'message': 'Operation Failed',
'detail': 'Data Policy Exception: \n\tThe following fields are mandatory: Resolution code'},
'status': 'failure'}
```
This occurs when I do it through the REST api explorer as well.
I am currently using an instance running Utah

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2023 06:33 PM
"2" is not a valid value for close_code (aka Resolution code). Examples of valid close_code values from a PDI are "Duplicate", "Known error", "No resolution provided", "Resolved by caller", "Solution provided", "Workaround provided", "User error". The values in your instance may be different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2023 12:38 AM
Hi Sebastian,
Error you are getting because of the wrong value passing in the Resolution code which is mandatory field checking data policy.
Please use the below payload:
{
"caller": "admin",
"resolution_code": "Known error",
"incident_state": "2",
"close_code": "2",
"resolution_notes": "resolved-test",
"close_notes": "resolved-test",
"resolved_by": "system",
"resolved_at": str(datetime.datetime.now()),
}
Resolution code
- Kailas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2023 07:14 PM
Dear Sebanstian,
I hope your issue has been resolved. If not, feel free to reach out me. I am happy to help.
- Kailas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2025 02:34 PM
I have this issue as well when I try to curl to resolve a problem like this:
curl -X PATCH "https://service-now.com/api/now/table/problem/bd27af94c3bb12104fcb1933e40131a6" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --user "admin:password" \ --data '{ "problem_state": "107", "active": "false", "assigned_to": "6816f79cc0a8016401c5a33be04be441", "resolution_code": "fix_applied", "resolved_by": "6816f79cc0a8016401c5a33be04be441", "resolved_at": "2025-02-14 22:50:00", "resolution_notes": "Enabled the Ethernet0/0.10 interface on Router R1, restoring connectivity between PC1 and PC2.", "close_notes": "Problem resolved successfully.", "work_notes": "Closing issue: Enabled Ethernet0/0.10 on Router R1, PC1 to PC2 connectivity restored." }'
I get this error
The following fields are mandatory: Resolution code"},"status":"failure"}
But I am passing it a valid resolution code?