How to set mandatory fields for REST API insert/update without affecting record producers?

JC S_
Mega Guru

We are trying to enforce mandatory fields when incident tickets are created/updated via REST API. To do this, we created data policies, however, this affected our Service Catalog items that is creating incident tickets via record producers. How can we implement mandatory fields for incident tickets created/updated via REST API without affecting the record producers on our Service Portal?

13 REPLIES 13

Harish KM
Kilo Patron
Kilo Patron

you can add one condition in UI policy like Task type is Incident. So that this would run only on incident


Regards
Harish

Chuck Tomasi
Tera Patron

Best practice is to use an import set REST API (not the direct table API) and then you can uncheck this box on your data policy:


find_real_file.png


Reference: Data policy


Import sets will not suit the way our integration works because we need to query/update back to incident table in near real-time. We created a custom interface that directly calls on the table through REST APIs. Does the platform does not support applying mandatory fields policies through REST API?


I'm afraid I don't understand the resistance to using an import set. Going from direct table access to import set API is not a huge effort on either end of the integration and you gain error checking/security in the process.



To change your 3rd party app (which you seem to have some level of control over) is just modifying the end point. Your data will be placed in the import set table instead of directly in to the incident table. From SN side, you create a transform map on the import set table to do some error checking, data manipulation (if needed) and save the record in the incident table. Much safer from a security standpoint and not a lot of effort to get there.



At this point, I don't see anything that says "Apply to REST" like there is "Apply to SOAP".


I invite you to open an enhancement request! Our product managers DO listen.


Enhancement requests: Tell us how you would improve the ServiceNow product