@Brad Bowman that worked. I just realized however that I have some RITM's (not many) that have parallel tasks, if i place two tasks 'on hold' and then move one of them back out of 'on hold', i'm not sure how that is going to affect the RITM state here. Any suggestions?

 

Thanks again!

Hi @Russell Abbott ,

 

Yes, latest update will execute Business Rule and the RITM State will be updated back to WIP.

 

Just one more way to implement your requirement is by Flow Designer. Have you tried that?

Flow Designer is very easy to build, with no code, to build complex flow.

 

Try once with Flow Designer:

reshmapatil_0-1671473028887.pngreshmapatil_1-1671473065333.pngreshmapatil_2-1671473130577.png

 

reshmapatil_3-1671473169149.pngreshmapatil_4-1671473218406.png

 

 

Regards,

Reshma

**Please mark my answer correct or helpful based on the impact**

Thank you for your input here. We have a very complex Flow that was designed by a vendor when we had our implementation phase. I actually find Flow Designer to be very difficult to read. Part of that is more than likely my lack of training in that module, i found the older Workflow Editor much easier to understand.

With your notes however, I will look into that further

If you want the RITM to not change State to In Progress if one of its tasks is Pending, then a script like this should do that:

(function executeRule(current, previous /*null when async*/) {
	gs.addInfoMessage("current task state = " + current.state);
	var gr = new GlideRecord('sc_req_item');
	if (gr.get(current.request_item)) {
		if (current.state == -5) { //Pending
			gr.state = -5; //Pending
		} else {
            var sctask = new GlideRecord('sc_task');
            sctask.addQuery('request_item', current.request_item);
            sctask.addQuery('state', -5);
            sctask.query();
            if (!sctask.next()) {
			    gr.state = 2; //In Progress
            }
		}
		gr.update();
		gs.addInfoMessage("the RITM set state is " + gr.state);
	}
})(current, previous);

 

Thank you for that info. I wish SN forums had a tip jar!