Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Workflow Wait condition script

Sam Ogden
Tera Guru

Hi All,

I've created a new workflow for a catalog Item.   The Catalog item has 5 checkbox variables.   Each checkbox decides if a task is generated.   We have scenarios however that once the ITEM has been submitted we might need to manually create further tasks.

I've created a wait condition script to check all tasks are closed before moving to a run script to close the ITEM.

For example If 2 checkboxes on the catalog item were true, 2 tasks get generated.   We then manually create a 3rd task.

If the manually created task is closed before either of the workflow generated tasks the workflow works fine.

If the manually created task is the last task to be closed the workflow remains stuck at the wait condition.   If I then go into the workflow context and 'nudge' the workflow, the wait condition runs and the workflow completes.


Is there a way to amend the workflow or some other means to get the workflow to complete without having to manually nudge the workflow?

Below is the workflow and the wait condition script:

find_real_file.png

find_real_file.png

Any help is greatly appreciated

Thanks

Sam

1 ACCEPTED SOLUTION

Hi Andrii,



Thanks for all your help on this.   I have managed to get this working following trawling through many articles on here.   one had a link to the following:


Condition Activities - ServiceNow Wiki


section 4.4 example script got this working.



Thanks



Sam


View solution in original post

12 REPLIES 12

I can't see anything in the workflows that would stop the business rule?


any suggestions?



Thanks



Sam


Below is an example.



find_real_file.png


find_real_file.png



find_real_file.png



The only part that is different between each one is the short description and assignment group


Hi Andrii,



Thanks for all your help on this.   I have managed to get this working following trawling through many articles on here.   one had a link to the following:


Condition Activities - ServiceNow Wiki


section 4.4 example script got this working.



Thanks



Sam