workflow for ritm> need to create workflow activity on if sctask is closed skipped
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 02:24 PM - edited 02-27-2025 02:29 PM
So, I have a workflow for a request item that creates catalog tasks. I would like to have the "IF" workflow activity to check if the sctask before it was closed skipped and if so follow the alternate path. I have tried it and it doesnt seem to skip and follow the alternate path
// Check if the SCTASK in this RITM is "Closed Skipped"
var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item', current.sys_id);
taskGR.addQuery('state', 4); // State 4 = Closed Skipped
taskGR.query();
if (taskGR.next()) {
answer = true;
} else {
answer = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 02:41 PM
Hi @RBlor
The advance script in the IF workflow activity looks for answer as yes or no. Instead of true and false, please use ‘yes’ or ‘no’
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 04:12 PM
recieved an error when i did the change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 04:23 PM
Please replace answer = Yes with:
return 'yes';
and answer = No with
return 'no';
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 10:24 PM