- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 09:40 AM
@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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 10:01 AM - edited 12-19-2022 10:01 PM
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:
Regards,
Reshma
**Please mark my answer correct or helpful based on the impact**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 01:55 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 02:54 PM
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 03:04 PM
Thank you for that info. I wish SN forums had a tip jar!