
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 11:52 AM
We recently changed or system to that is someone marks a task as closed incomplete it would make the RITM Closed Incomplete. I am now running into an issues the below scenario.
With one request we have multiple tasks being created and going to a join. There is times where I may need only 2 out of the 3 tasks. If I use and if condition to not create one of the task it always sets the RITM as closed incomplete even if the other tasks are set to closed complete. Any way around this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2015 08:50 AM
I got an answer on this from HI. Seems the join doesn't work the way you would expect. It always goes down the incomplete path if one of the paths connected to it does not transition. Here is how they had me get around this. User create event with only giving it a name. Basically a dummy event that doesn't really do anything. Then have your catalog task that could get skipped go to the dummy event along with the if statement that bypasses the task. Then you would have the dummy event transition to your join. After the joint you have to do another if statement to determine if any of the tasks are closed incomplete so you can set the RITM to closed incomplete if you that is what you want to do. Below is a screenshot example of the workflow with the dummy event and the code for the IF statement if I mentioned above.
answer = ifScript();
function ifScript()
{
var task = new GlideRecord('sc_task');
task.addQuery('request_item', current.sys_id);
task.addQuery('state', '4');
task.query();
if(task.next())
{
return 'yes';
}
return 'no';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 12:17 PM
Depending upon what was originally scripted to close-incomplete the Requested Item will determine the best approach. I am guessing that the functionality is in a business rule that runs on the Catalog Task table. You may be able to change the logic to only set the Requested Item to be closed-incomplete if there is only one task associated with the Requested Item. Hopefully your workflow creates the tasks in parallel and this will work as expected. If you have tasks in serial, you could create a method of setting a check-box on either the Requested Item, or the Catalog Item that indicates the Requested Item should or should not be closed-incomplete. Let me know if this second option is worth pursuing.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 12:21 PM
Its what what eve is out of the box. All I do is set the request to a state of canceled if it goes down the closed incomplete when it hits the join. For some reason if I do not create the task it goes down the close incomplete path when it hits the join. I don't think I need to do something in the workflow not with the business rules.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 12:25 PM
Please provide what you have in your join script so I can take a look at it. We may just need to add logic to it so that it will only mark it as closed incomplete if all tasks are marked as closed incomplete.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 12:28 PM
There is not script in the join. It just has 2 conditions.
activity.result == 'incomplete'
and
activity.result == 'complete'