how to get the status of the ticket in servcienow api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 09:46 PM
I have servicenow api, which will give state filed ,I want to get the status of the ticket ,whether it is closed/pending through api.I need to get state filed instead of value displaying want to get ticket status.
- Labels:
-
Multiple Versions
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 09:53 PM
Hi there,
So you are after the display value (label) instead of the value? Like:
You can achieve this by applying sysparm_display_value. Set it to true or all. So for example:
sysparm_display_value=all
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
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
‎03-16-2022 09:55 PM
For example:
GET https://your-instance.service-now.com/api/now/table/incident?sysparm_display_value=all&sysparm_limit=1
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
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
‎03-16-2022 09:56 PM
Hi
You can just add &sysparm_display_value=true on your url which will give you display value
ex: https://XXXXXX.service-now.com/api/now/table/incident?sysparm_query=active%3Dtrue&sysparm_display_value=true
you can set a query parameter using REST API Explorer named sysparm_display_value
.
Value options are:
- true returns display values for all of the fields.
- false returns actual values from the database. If a value is not specified, this parameter defaults to false.
- all returns both actual and display values.
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 09:57 PM
Hi,
to get choice label you can use the endpoint with parameter mentioned by Mark
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader