SCTask cancel when RITM is cancelled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 10:44 AM
Hello Experts,
I have written the below BR on RITM table to cancel active catalog tasks when RITM is cancelled. But, Though the value of "Closed Cancelled" state is '12', The below script executes but sets SCtasks to "Closed Incomplete" instead of "Closed Cancelled". I removed "Closed Incomplete" state from the choice list of sctasks but still the "Closed Incomplete" is being set after the below BR is executed.
var sctask = new GlideRecord('sc_task');
sctask.addQuery('request_item', current.sys_id);
sctask.addActiveQuery();
sctask.query();
while(sctask.next()){
sctask.state = '12';
}
How can I achieve this and set sctask state as "Closed Cancelled" instead of "Closed Incomplete"?
Thanks,
Rocky.
- Labels:
-
Script Debugger
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 11:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 11:31 AM
then you need to change it in OOB script
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 11:36 AM
first find out where 'Closed Cancelled' script is running, then make changes as per your requirement
Shakeel Shaik 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 11:37 AM
Well it was a possibility. I still think that the workflow update is winning out over the business rule. Is there some reason "Closed Incomplete" is not ok?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 02:40 PM
To eliminate the workflow as the possible culprit, set the order of your business rule to a value over 10,000, that will ensure it fires after the workflow has completed