How do I create multiple tasks based on variables selected on catalog item

Aru
Kilo Explorer

Hello!

I have created a catalog item for Staff Termination and am trying to find a way to create multiple tasks as per the variables selected on that catalog item.

At present the workflow created one task at a time - second task is created only when when the first task is closed. Instead, I need multiple tasks as per the variables selected i.e one primary task and multiple child tasks which can be handled by separate teams at the same time.

E.g   primary task is created for login account termination, second task for collecting desktop equipment , third task for collecting mobile equipment : all at the same time

Here are the variables on my item: laptop , Mobile and salesforce .

Variables.png

Below is the workflow where tasks get generated only in sequence.

Workflow.png

Any help would be really appreciable as I am relatively very new to scripting and looking for some solution

Many thanks!

8 REPLIES 8

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Arundhati,



If you want task to be created simultaneously then you have to uncheck the field "Wait for completion" on the catalog task activity. This will make the workflow to proceed to create the other task. However you have to select the "Run script" activity and place this one before the end workflow.


In the Run activity you have to script so that it will GlideRecord the "sc_task" table and halt the workflow until all the tasks are closed.



I hope this helps


Thank you Pradeep for your prompt help! I am still getting a hold on scripting as am new to it. Will give it a go and let you know!


Regards


Aru


Ajai S Nair
Giga Guru

What Pradeep has told is correct. Since you have checked the field "Wait for completion" on the first catalog task activity.It is waiting for the completion of it to proceed further . So uncheck the field "Wait for completion" on the catalog task activity.Then multiple tasks will be created as per the conditions and variables selected on your catalog item.



Hope this makes it clear


Hello Ajai


Thanks a lot for your quick help! I unchecked the 'Wait for completion' however what it did was to close the Request itself and kept the tasks open.


Regards


Aru