Incident table Metadata

sai krishna25
Kilo Contributor

I am working on integration on client incident form to show dynamically inside our platform. I am looking for an API where we can find the list of fields and reference table from where the field values need to be pulled from?

3 REPLIES 3

puneetgoels1
Tera Guru

you can use rest table api call. 

 

Search for rest api explorer in filter navigator to get the exact syntax.

sai krishna25
Kilo Contributor

I am looking for an API where I can find the list of fields and also a list of field reference for the incident table. For example 

These are list of fields :

assignee field can be retrieved from sys_user,

priority field can be retrieved from sys_choice for table incident

 

Something like that

See below as en example. This will give you metadata for a table

var request = new sn_ws.RESTMessageV2(); request.setEndpoint('https://<your instnace name>.service-now.com/api/now/table/sys_db_object/<incident table sys id>'); request.setHttpMethod('GET'); //Eg. UserName="admin", Password="admin" for this code sample. var user = 'admin'; var password = 'admin'; request.setBasicAuth(user,password); request.setRequestHeader("Accept","application/json"); var response = request.execute(); gs.log(response.getBody());

If you use sys_dictionary, it will give you metadata of one of the fields.

As GET method returns data of one record only but you need data for multiple records(columns of a table), my best bet is to write a scripted web service on sysDictionary table