Having issue with mandatory fields

DineshD
Tera Contributor

I'm currently working on ServiceNow REST API to create Incidents. For that I need to get the fields that are mandatory, so that I  can make them required. 

 

I have already tried getting data from sys_dictionary table but the mandatory fields are shown "false" in "mandatory" attribute.

 

Can anyone help me out?

9 REPLIES 9

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Now in ServiceNow a field can be mandatory from various places like client script and UI policy so it would not be possible to get all details of mandatory field using dictionary.

 

Rather I would suggest if it is a scripted rest api you can return a error if there are any mandatory fields not passed.

 

You can check the below post for the same:-

 

https://www.servicenow.com/community/developer-forum/error-of-missing-mandatory-fields-in-rest/m-p/1...

 

Please mark my answer as correct based on Impact.

DineshD
Tera Contributor

Hello @Saurav11 ,

I don't think scripted REST API will be of use since I am creating Incidents out of the System(not ServiceNow) .

 

Did not get you so are you using the API to create Incident from other system to ServiceNow right?

 

OR

 

Is it you are creating Incident from ServiceNow to other system

DineshD
Tera Contributor

I want to create Incident in ServiceNow for which I need to call the REST API from the other System