ServiceNow REST API - How to GET required/mandatory fields and data

Tony93
Kilo Contributor

We are looking for a ServiceNow API to get all required/mandatory fields and its data, that a user has to provided before creating a new incident. Please let us know if you know it.

Refer to the attached image below for more detail.

Example:

  • required/mandatory fields --> [Category, Subcategory, Impact, Urgency, etc ...]

  • Data of fields:

Urgency --> [1: Critical, 2 - High, etc …]

Category --> [Security, Repair, Remove, ….] ....

Thank you.

 

2 REPLIES 2

Ct111
Tera Sage

Hi,

You can refer below link where Josh.Neirus has shown how to throw error in response of REST if mandatory fields are not filled.

 

Refer this link as example  it will help you

https://community.servicenow.com/community?id=community_question&sys_id=835fb2a9db58dbc01dcaf3231f96...

 

Mark my ANSWER as CORRECT n also HELPFUL if it works

Tony93
Kilo Contributor

Hi CreativeThinker,

 

Thank you for your solution. However, we think it's not a full solution that we need. If ServiceNow server changes or adds new required fields, we have to change our code to create incidents through API.

 

Is there any way we can get all the required fields FIRST before creating a new incident through API? We don't think ServiceNow supports any RST APIs to get required fields, right?

 

Thank you,