Why is SCTASK not closing the RITM?

qwertyflop
Giga Guru

I have a super simple catalog item and workflow on the sc_req_item table. 

find_real_file.png

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?

4 REPLIES 4

sonali panda1
Kilo Sage

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.

Hi Did you check this?

Community Alums
Not applicable

I always use a 'Set Values' activity at the end of the workflow, to set the RITM state and stage:

find_real_file.png

find_real_file.png

This ensures the RITM closes correctly, as does the REQ.

Hope that helps!

That was a great answer, will make a note to use these steps if/when I come across a similar issue. Thank you.