Automating the change task closing process using REST API''s
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2018 09:05 AM
I am wanting to utilize the supplied REST API's to automate the process of closing change tasks when given an array of change request numbers. I have noticed that the change requests list the different change tasks at the bottom of the page, but when running an API call, there is no information returned regarding the change tasks.
Essentially the automation process should go as follows:
- Search for CR
- Select relevant change tasks according to assignment group
- Open change tasks and fill in any relevant information,
- Close tasks
- Repeat for remaining CRs
Please let me know if my approach is incorrect or with any advice.
Thanks,
Rahul
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2018 01:22 PM
If you are using the table API, you can only query 1 table at a time. Changes are stored in the change_request table and tasks are in the change_task table. So you cannot perform 1 query to do all your steps. You could explore a scripted rest API where you pass it a list of Changes and it perform the functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 05:34 AM
Right, so is there a way to obtain the change task numbers from an individual CR? Otherwise I see the process as individually parsing each and every change task from the change task table and retrieving the CR numbers from the change task response.
My issue is that I cannot see the associated change task numbers in the CR API response. I would then want to take the change task numbers from that specific CR and do another API call to preform any operations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 12:18 PM
You should look at Rest API Explorer if you haven't already. It will show you the data coming from the APIs to help:
Again the data you are after is in two tables so using the table API you will have to perform multiple actions. You can search the change_task where change_request = the sysid of the change.