The CreatorCon Call for Content is officially open! Get started here.

Adding ad hoc tasks which will

Julie Catano
Kilo Guru

Looking for some guidance. We have a few request workflows in our company that our Service Desk regularly have to raise "ad hoc tasks" during the lifecycle of the fulfilment should they require other teams to be involved.

 

Issue:

When the last WF task completes, the WF closes the RITM. That's all good. But now we are going to let users create ad-hoc tasks manually on the RITM. That means when the last WF task closes it will close the RITM and orphan the manually added tasks.

 

Looking for a business rule that if an ad hoc task is added that it will wait for all tasks to be close completed, closed incomplete, closed skipped and then the RITM will change the stage to Completed and state to Close Completed.  See attached code I found and doesn't seem to work.  Any help is much appreciated.

9 REPLIES 9

Thank you for your quick response, one last clarifying question.  For the filter condition could I use my example above for "all" my workflows under the service catalog?  From your example it looks like I would need to list all of our items separately.   

Still not working after I selected my service catalog.

Hi Manmohan,

 

I came across this article since I have a similar use case. The only issue I ran into is that after I added the adhoc task via the RITM related list then complete both the regular task and adhoc task (in that order) the Request remained open. The request and RITM should go to 'Close Complete'.


See screen shot
Any suggestion as to why this is  happening?

I had to add a "wait condition" in each workflow after my catalog task.

used advanced option.

 

// Set the variable 'answer' to true or false to indicate if the condition has been met or not.
var tskRec = new GlideRecord("sc_task");
tskRec.addQuery('request_item', current.sys_id);
tskRec.addQuery('active', "true");
tskRec.query();
if (tskRec.next()) {
answer = false;
} else {
answer = true;
}
 

Thanks Julie. I too had a wait condition but the script was different. I used your script and it worked. Once again thanks for the assist.

Garfield