- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2020 03:12 AM
Use Case:
I'm writing an application which will create an incident or problem ticket in my ServiceNow instance. What I first need is metadata about the fields to create an incident or problem in the respective table. There could be user defined custom fields and also I need to render which fields are mandatory in the UI of my application. Then after getting inputs on the various fields I will submit a POST request to my instance create an instance/problem.
Issue:
I'm currently using the following query on sys_dictionary table for the metadata I need:
"api/now/table/sys_dictionary?sysparm_query=name=incident&sysparm_fields=column_label,mandatory,internal_type"
But, this query is not returning all the fields - for example the fields 'assigned to' and 'assignment_group' are missing in the result. Only a reduced set of entries from the incident table seems to be returned for this query on sys_dictionary table.
I have tried to get the metadata from sys_documentation table and also api/now/doc/table/schema API, but these are missing the 'mandatory' attribute for a field and again the result seems to be partial.
Can I get some help on how to get the information I desire using the REST API to ServiceNow instance?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2020 10:09 PM
Hi there,
Interesting one! I don't know a solution from the top of my mind, have to do a brainstorm for this 🙂
Though the fields you are "missing", are actually all fields that come from table extension. For example, assigned to / state / description / etc. >>> all fields on the Task table, not Incident.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2020 10:09 PM
Hi there,
Interesting one! I don't know a solution from the top of my mind, have to do a brainstorm for this 🙂
Though the fields you are "missing", are actually all fields that come from table extension. For example, assigned to / state / description / etc. >>> all fields on the Task table, not Incident.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2020 10:17 PM
you have to do here manual work to get the field details ( check for mandatory details )
how about if some fields are mandatory by UI Policy, client script, data policy. which you wont be able to get by using api.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2020 10:22 PM
another point here if you will filter on "sys_dictionary" table by using table name ( in your case incident) then you wont be able to get the "assigned to' and 'assignment_group" field because these fields are available on base table (task table)
you can simply put the filter on the sys_dictionary.list and you will see the result.
If my answer helped you, kindly mark it as correct and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2020 09:27 PM
Thanks for the helpful replies. I understand that for a problem or incident, I need to combine fields from the parent table which is 'Task'.
On a related note, what is the parent table for the Agile Development tables - rm_epic, rm_story, rm_enhancement etc.? I can't seem to find this in the documentation.