Create second task when first task is "closed complete."

Lance_1
Tera Contributor

Helo!

 

I have an ask to edit a workflow to create a second task when a first task is "closed complete."  Please see attached screen shot.  But the logic breaks.  As is the task is always made, no matter what the closed condition of the first task is.  If I flip the logic the task is never made, no matter what the closed condition of the first task is.  What did I miss or am doing wrong?

5 REPLIES 5

Prince Arora
Tera Sage
Tera Sage

@Lance_1 

 

1) Set the wait for completion to true as suggested by @Sagar Pagar Sir and this is present in the catalog task, please open first catalog task and look into wait for completion 

2) Add the script in the if condition

3) You can remove the wait for activity

 

var tskRec = new GlideRecord("sc_task");
tskRec.addQuery('request_item', current.sys_id);
tskRec.query();
if(tskRec.next()){
if(tskRec.state !=3)
answer = false;
else
answer = true;
}

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.