Business rule to move change tasks from Pending to WIP

stevezempke
Tera Contributor

I am setting up a change mgmt workflow with many tasks.  For this discussion let's say there are 10 tasks.

My user wants all 10 tasks to appear at one time so everyone associated with the change knows they will have a task to perform.

Now when the master change ticket gets to 'Scheduled', I set off all 10 tasks and have an assignment group/assignee associated with each.

The 1st task needs to be the only one in Open, Work in Progress, etc., and the other 9 need to be in Pending.

Once task 1 is closed, tasks 2,3,4,5 need to move from Pending to Work in Progress.

Once tasks 2,3,4,5 are all closed, tasks 6,7,8,9,10 move from Pending to Work in Progress.

When tasks 6,7,8,9,10 are closed, the master change tickets goes to Closed.

I've looked at the community site and seen many threads around this topic but can't find any code/script that shows how to move change tasks from Pending to Work in Progress as described above.

I don't think this would be difficult but can't seem to find what coding I need to put in a business rule, client script, etc., to make this work.

any assistance is greatly appreciated for the code i need to create to make this process work.

thanks in advance for your help.

2 REPLIES 2

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Hi,

Now, if it isn't to much work, I would move this to a flow instead. then you can do it all without writing any script at all. But if you need to do it at a workflow I would say you need to use the activity "Wait for conditions" and then we the correct tasks are closed, then you can with a script fetched all tasks that are connected to the "current" change and then change the state on them with script. 

So even if you don't do it with a flow, I would still keep it in the workflow and avoid Business rules and so on.

//Göran
Feel free to connect with me:
LinkedIn & Twitter
Subscribe to my YouTube Channel
Buy The Witch Doctor's Guide To ServiceNow

stevezempke
Tera Contributor

Thanks for the info.  i'm not an expert in scripting so what would i put in the 'Wait for condition' activity between the task sections so section 2 (tasks 2,3,4,5) doesn't start until task 1 is done and section 3 (tasks 6,7,8,9,10) doesn't start until section 1 and section 2 is done.