Why is SCTASK not closing the RITM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 02:38 PM
I have a super simple catalog item and workflow on the sc_req_item table.
I thought that whenever the Catalog Task is closed that the RITM was supposed to automatically change to whatever state the SCTASK was closed with (i.e. if the SCTASK is set to Closed Complete, the RITM should be Closed Complete) but that is not happening. The RITM remains in the Open state when the SCTASK is closed.
What am I doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 03:47 PM
That is not oob functionality. Add a new activity as run script after the catalog task activity and add a code
var rec = new GlideRecord ('sc_task');
rec.addQuery('req_item', current.sys_id); // give the request item field name for req_item
rec.query();
if(rec.next())
{
current.state= rec.state;
}
Else instead of values pass the label names if they are same If you don't want to update the workflow, you can alternately lwrite a Business rule if this has to apply to all catalog items. But if it's for just this single item it's good to be in workflow for better maintainability.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2022 03:04 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 06:38 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2022 05:18 PM
That was a great answer, will make a note to use these steps if/when I come across a similar issue. Thank you.