workflow for ritm> need to create workflow activity on if sctask is closed skipped

RBlor
Mega Guru

So, I have a workflow for a request item that creates catalog tasks. I would like to have the "IF" workflow activity to check if the sctask before it was closed skipped and if so follow the alternate path.  I have tried it and it doesnt seem to skip and follow the alternate path

 

// Check if the  SCTASK in this RITM is "Closed Skipped"
var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item', current.sys_id);
taskGR.addQuery('state', 4); // State 4 = Closed Skipped
taskGR.query();

if (taskGR.next()) {
    answer = true;
} else {
    answer = false;
}

 

 

RBlor_0-1740694037128.png

 

RBlor_3-1740694883910.png

 

 

 

14 REPLIES 14

Swapna Abburi
Mega Sage
Mega Sage

Hi @RBlor 

The advance script in the IF workflow activity looks for answer as yes or no. Instead of true and false, please use ‘yes’ or ‘no’

RBlor_0-1740701517688.png

recieved an error when i did the change

Please replace answer = Yes with:

return 'yes';

and answer = No with

return 'no'

If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

RBlor_0-1740723842232.png