workflow is not working fine, always going on the wrong condition

David Cross
Tera Expert

My Workflow is always going on the complete condition in join block.
If my task is incomplete or Skipped then it must not notify, it should go to set value incomplete

please help me to make the correction

 

find_real_file.png

1 ACCEPTED SOLUTION

Hi,

 

Since you just are checking if the state is incomplete or skipped then do something else something.. Just have the catalog task 'wait for completion' checked. So in the If block .. condition builder add state is one of incomplete/skipped and submit the activity. Then in No condition notify the hr . For yes, point to the activity you want it to do. 

View solution in original post

5 REPLIES 5

sonali panda1
Kilo Sage

Hi,

Its just one activity coming to Join block. I dont see why a Join block is needed though. The create task should not have the wait for completion checked. You can have a If block and add the check to route to notification and state change activities. Let me know if this helps.

Thank you for responding here, 

I did used If condition, that did not work either. I'll again try for If condition here.

 

If you have the script for IF condition, Can you please update here

it will be helpful for me 

 

Hi,

 

Since you just are checking if the state is incomplete or skipped then do something else something.. Just have the catalog task 'wait for completion' checked. So in the If block .. condition builder add state is one of incomplete/skipped and submit the activity. Then in No condition notify the hr . For yes, point to the activity you want it to do. 

Hi,

This was my If script

function ifScript() {
var v = current.sys_id;
var returnVal = 'no';
var ob = new GlideRecord('sc_task');
ob.addQuery('request_item', v);
ob.query();
while (ob.next()) {
if (ob.state == 3) {
returnVal = 'yes';
} else {

returnVal = 'no';

}
}
return returnVal;
}