RITM closing before all tasks are completed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 08:12 AM
Hi, Service Now rookie here so please be patient.
I have a very simple workflow that creates 4 tasks sequentially -- each task is created once the previous task is closed. What I'm finding, however, is that when the first task is closed the RITM closes. What I would like is for the RITM to close only after the last task in the sequence is closed. Would appreciate any assistance anyone can provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 10:21 AM
Hmm do you have a join and wait condition in your workflow ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 11:13 AM
I didn't have either, but I added a Join after the last task (similar to your mock up). Same result. After the first task closes, the RITM closes. I'm not familiar with using a Wait condition, so I don't have it. Sorry, very new to Service Now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 12:00 PM
This is the wait condition I use after Join
/*This script will check for all tasks associated with the request item that are not 'Closed complete', 'Closed incomplete', or 'Closed skipped', and that are not governed by workflow. If there are any, then the workflow will wait.*/
var gr_tsk = new GlideRecord("sc_task");
gr_tsk.addQuery('request_item', current.sys_id);
gr_tsk.addQuery('state', '!=', '3');
gr_tsk.addQuery('state', '!=', '4');
gr_tsk.addQuery('state', '!=', '7');
gr_tsk.addQuery('wf_activity', '');
gr_tsk.query();
if (gr_tsk.next()) {
answer = false;
} else {
answer = true;
}