Incident Closure via REST API Fails with "Cause code" Mandatory Data Policy Exception

meena eethakatl
Tera Expert

Hi Team,

We are facing an issue while resolving Incidents through the ServiceNow Table API.

When updating an Incident to the Resolved state via a REST API PUT request,

we receive the following error:

{
"error": {
"message": "Operation Failed",
"detail": "Data Policy Exception: The following fields are mandatory: Cause code"
},
"status": "failure"
 
}
Show more lines
reuqets payload - 
{
"work_notes": "testing",
"incident_state": "6",
"close_code": "Solved",
"close_notes": "testing",
"u_cause_code": "Application - Caused by Change",
"u_solution": "resolved"
}

Observations:

  • The Cause Code field is being passed in the API payload.
  • The Incident can be resolved successfully from the UI.
  • The issue occu
  • rs only when resolving through the REST API.
  • A Data Policy is enforcing Cause Code as mandatory.

how to fix it

3 ACCEPTED SOLUTIONS

Mark Manders
Tera Patron

Validate that the cause code you are sending is correct. From the looks of it, it's a custom field, so not sure if it's a string or a choice field. If it's a choice field, make sure it's the correct VALUE of the choice (not the LABEL). 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

Yes, u_cause_code is a choice field, and we are passing a valid value in the API payload. However, the value is not being updated in ServiceNow, and we continue to receive a Data Policy Exception stating that Cause Code is mandatory. how to fit it

View solution in original post

@meena eethakatl 

the OOTB data policy checks 2 fields during INC Resolution i.e. close_code and close_notes

are you setting correct choice values for close_code in your payload?

below are the choice values

Screenshot 2026-10-26 154902.png

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Mark Manders
Tera Patron

Validate that the cause code you are sending is correct. From the looks of it, it's a custom field, so not sure if it's a string or a choice field. If it's a choice field, make sure it's the correct VALUE of the choice (not the LABEL). 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Yes, u_cause_code is a choice field, and we are passing a valid value in the API payload. However, the value is not being updated in ServiceNow, and we continue to receive a Data Policy Exception stating that Cause Code is mandatory. how to fit it

Hi @meena eethakatl 

 

Check the Data policy condition which is triggering for u_cause_code at servicenow end.

 

Check if the data policy has other conditions as well (like  triggering when state /incident_state transitions to Resolved or Closed) . 

 

In that case in the  update API payload, you have to send other value like state  along with u_cause_code  etc.

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Ankur Bawiskar
Tera Patron

@meena eethakatl 

As mentioned by Mark, please validate the choice value in the payload you are sending

Please let us know if that resolves the issue

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader