Closing RITM in workflow when no task created

jordanr
Tera Contributor

I have a workflow for a catalog item for share drive access for onboarding. The item is automatically added to the order guide in the onboarding process. A user can either enter the access information or leave the text field blank if they do not need access. The first thing in the workflow is an IF action that tests if the variable is != ''. If yes a catalog task is created. If no it goes to Set Values action Stage:Completed. The issue we are having is if the variable is blank   the RITM is not closing when the request and tasks close.

In the ifScript() I added current.state='3' if variable=''.   This changes the state field to closed complete like I wanted, but it will not close the completed stage unless I change it to closed incomplete or reopen it and then change it back to close complete. I have tried putting actions in different places of the workflow but nothing seems to let me close it without the change.

Is there a rule I may be overlooking or is there a specific place I need to put the script to get it to close?

Any suggestions are much appreciated.

Thank you

1 ACCEPTED SOLUTION

manikorada
ServiceNow Employee
ServiceNow Employee

Jordon,



The Workflow will not complete the update to the record unless the Workflow is paused for some reason.


I would suggest try to add a Timer for 2seconds after the If activity before it sets the Stage to see if it solves your issue.


View solution in original post

3 REPLIES 3

manikorada
ServiceNow Employee
ServiceNow Employee

Jordon,



The Workflow will not complete the update to the record unless the Workflow is paused for some reason.


I would suggest try to add a Timer for 2seconds after the If activity before it sets the Stage to see if it solves your issue.


This got it working. Thank you very much!


randrews
Tera Guru

can you paste the item workflow in here so we can look at it.