- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 11:54 PM
Hi,
I am very new to this SNOW.
I am looking for help in REST API solution where I can pass the Change Request Number and in the output response I can get the Change request values like "Type", "Configuration Item", "Short description", "description".
Something like - https://test.service-now.com/api/sn_chg_rest/change/standard/CHG1234567
some this kind of URL and in response the values of these fields from the CRQ - "Type", "Configuration Item", "Short description", "description".
Looking forward for some help.
Thanks
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 01:23 AM
Hi
CI is also coming in correct format. This is how ServiceNow provides results for any reference field. If you are expecting Display value of CI, then make sysparm_display_value as true.
Then, your response would look like -
{
"result": {
"short_description": "testing else part",
"cmdb_ci": {
"link": "https://instance.service-now.com/api/now/table/cmdb_ci/f383a25ddb80d890bcb8dd3b5e96197a",
"display_value": "HelloCI"
},
"description": "Datachange Request"
}
}
Let me know if issue persists.
Mark this as Correct answer and close this thread for reference to other people seeking same info.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 12:16 AM
Hi
In the query parameter > sysparm_fields, put comma separated fields (column name not label) which you are expecting in result. It will work.
Attaching screenshot for reference.
Let me know if issue persists.
Mark this as Correct/Helpful if applicable.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 01:09 AM
Hi
I tried the approach you mentioned.
I fetched the data for 3 parameters - short description, description and configuration item.
I filled the sysparm_fields checkbox, I clicked on the pencil icon beside it and selected the three required fields as visible in second ss
but int the result body description and short description fields are correct but the configuration item is coming in weird form.
{
"result": {
"short_description": "testing else part",
"cmdb_ci": {
"link": "https://instance.service-now.com/api/now/table/cmdb_ci/f383a25ddb80d890bcb8dd3b5e96197a",
"value": "f383a25ddb80d890bcb8dd3b5e96197a"
},
"description": "Datachange Request"
}
}
please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 01:23 AM
Hi
CI is also coming in correct format. This is how ServiceNow provides results for any reference field. If you are expecting Display value of CI, then make sysparm_display_value as true.
Then, your response would look like -
{
"result": {
"short_description": "testing else part",
"cmdb_ci": {
"link": "https://instance.service-now.com/api/now/table/cmdb_ci/f383a25ddb80d890bcb8dd3b5e96197a",
"display_value": "HelloCI"
},
"description": "Datachange Request"
}
}
Let me know if issue persists.
Mark this as Correct answer and close this thread for reference to other people seeking same info.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 04:50 AM
Hello
Just wanted to follow-up whether your issues is resolved or you require further assistance on your problem statement.
If yes, let me know. Else, feel free to mark this answer as correct so that others can use it as correct reference.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 09:34 PM
Hi
Thankyou for sharing the knowledge. I had one more small doubt if you could help.
Can I some way take out the sys_id using API which is to be used when calling this above mentioned API.
Can you let me know if by change number we can take out the sys_id?
Thanks