- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2017 04:43 AM
I need some assistance in auto-canceling or closing related CTASK items when the CHG is moved to closed incomplete or canceled state. My current UI Action on the change will close the change request, but the underlying task is remaining open in the fulfiller's work queue. Thoughts?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 08:13 PM
HI Cyndi,
You will have to write a Business rule to achieve this
Table : Change_request
Type : After
Insert : true
Update : true
Conditions : current.state == 7 && current.state.changes() // place your values of state accordingly
Script :
abortKids();
function abortKids() {
if (current.sys_id == '')
return;
var kids = new GlideRecord('change_task');
kids.addQuery('parent', current.sys_id);
kids.query();
while (kids.next()) {
if (kids.active == true) {
kids.state = 7;
kids.update();
}
}
}
Note : This can also be achieved using UI action placing the same code. Let me know if you have any issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 03:52 AM
Thanks Scott!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2017 05:47 AM
Hi Cyndi,
the easiest way would be to create an "After Update" Business Rule on CR table with conditions on the states mentioned by you. In the script part of the business rule read all Change Tasks like mentioned by Manoj Kumar and update them to the appropriate state.
Regards,
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 03:53 AM
Thanks Stefan!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 04:51 AM
HI Cyndi,
were you able to solve your problem? Then please mark your question as "Answered". Otherwise it will unnecessarily still be listed as "Not answered" in the community.
Regards,
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 10:53 AM
I'm still testing...so far I am still struggling to get the tasks closed. Neither of the solutions above worked