priority state and etc fields values are not included in the incident XML
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I exported the incident xml, and found the priority , state, impact and etc values are missing only the id is present.
<state>2</state>
i need to value to be present in the exported xml as mentioned below, how to achieve ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago - last edited 4 weeks ago
@KushalL ,
By default, ServiceNow APIs (and XML exports) return the backend values (the numeric keys for fields like state, priority, impact, etc.). But you can always switch to getting the display values by:
Follow these steps : ( I will be performing these steps for a single record)
1. We will use - sysparm_display_value=all in REST/SOAP.
2. Use this URL - https://<instance>.service-now.com/api/now/table/<table_name>/<sys_id>?sysparm_display_value=all
For example - I want to export the XML for an Incident record with the sys_id 57af7aec73d423002728660c4cf6a71c, and my PDI name is dev226057.
The URL will be:
https://dev226057.service-now.com/api/now/table/incident/57af7aec73d423002728660c4cf6a71c?sysparm_display_value=all
Refer to below screenshots -
1. If you run that URL directly in Chrome: you’ll likely see a login prompt (username/password popup). That’s because ServiceNow REST APIs require authentication before returning data.
Fill the username and password. SignIn.
2. When you run the following URL in Chrome and log in with your ServiceNow credentials, you will see the record returned in XML format, including the display values:
Refer Below screenshot :
Note -
We used the API URL with sysparm_display_value=all, which ensures the response includes both the backend values (like 2) and their display values (like New) for fields such as state, priority, and impact.
Hope it helps!
Shashank Jain