How to fetch change task details associated with a change request ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2017 05:05 AM
Hi All,
I am trying to get the details of a change request usign the JSON service.
In the response , I am not able to find any change task details. Kindly let me know how to get the change task details assiciated with a change request.
Thanks!
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 05:31 AM
If you are starting with a change number and want to get a series of change tasks, you will need to do this with two queries.
The first gets the details of the change request (including the sys_id)
// Parse sys_id from response here
The second one looks for all the change_tasks where parent is the sys_id returned from the first query plus the date parameters you requested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 07:36 AM
Hi - was there supposed to be a second query in your example above?
I wouldn't be starting with a Change number. I want to show a team all the Changes (including their child Tasks) that are planned this week for their CIs, or their Assignment Group, for example.
Again, I'd think we're not the only company that needs this kind of view. So there really should be a standard "1-query" method to do this in SN out of the box.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 07:39 AM
Hi AJ,
I want to show a team all the Changes (including their child Tasks) that are planned this week for their CIs, or their Assignment Group
Thank you for the clarification. Understanding the underlying requirement or use case is always helpful. When people come and ask a technical question (their thought on what the solution is) you can often end up with sub-optimal answers.
That being said, yes, you can get this in one query. Query the task table and use a sysparm_query to filter on just the change_request and change_task tables to get the records you want. I recommend experimenting with the REST API Explorer to refine your query.
Getting Started with REST - ServiceNow Wiki
REST API Explorer - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 02:49 AM
RE: "from change number can we get the associated ctask numbers ?"
I assume by now you've found a query like the following?
https://{{instance-name}}.service-now.com/api/now/table/change_task?change_request=CHG0036876&sysparm_fields=number,sys_id