- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2016 08:33 AM
Hello
I need to get list of change_tasks for given change_request sys_id through REST API.
I make GET response for 'change_task' table, and receive response
{
"result": [
{
"sys_id": "---task-sys-id---",
"change_request": {
"link": "https://[instance].service-now.com/api/now/table/change_request/---request-sys-id---",
"value": "---request-sys-id---"
},
}
]
}
How can I add filter to GET request using sysparm_query to check for change_request.value field?
I am looking to something like "sysparm_query=change_request.value=---request-sys-id---".
I have no problem checking for simple fields, but cannot find documentation for syntax for nested json object.
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2016 09:24 AM
Hi Gleb,
That value property only exists in the JSON response. If you want to query on the sys_id of the change request from the change task, your query should be:
sysparm_query=change_request=---change request sysid---
So altogether that would be:
https://[instanceName].service-now.com/api/now/table/change_task?sysparm_query=change_request=---cha... request sysid---
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2018 11:02 AM
Hi Brad,
I have a similar problem where I am trying to query the incidents related to a specific CI. My first attempt was to use a nested json query to locate the value property of the cmdb_ci in the query of the incidents table. But similar to @glebr's post it's not working. Is there another approach?
{
"result": [
{
"number": "INC0000001",
"closed_at": "2017-08-12 23:10:06",
"cmdb_ci": {
"link": "https://[instance].service-now.com/api/now/v1/table/cmdb_ci/b0c4030ac0a800090152e7a4564ca36c",
"value": "b0c4030ac0a800090152e7a4564ca36c"
},
...
}
]
}