Create an unlimited number of Catalog Task via Workflow

Cat
Mega Guru

Hi All,

 

I have a form that I'm working on, where they would like to be able to create another task, if they close the current task as "further development required".

At the moment, the way I have it set up, it will close the task but immediately reopen it. Because there are an unlimited number of tasks that could be open, I need it to be a loop.

This is what my workflow looks like:

Cat_0-1710510349307.png

I don't want it to reopen the task, but rather to open a brand new task as many times as they set the further development parameters. Do I need to add a close task element to the workflow?

 

Does anyone have an ideas?

 

Cat

 

1 ACCEPTED SOLUTION

AshishKM
Kilo Patron
Kilo Patron

Hi @Cat,

First of all, do not plan for unlimited tasks.

Second, in workflow if you point the same catalog task object, it will re-open.
So the “unlimited” option not feasible with single catalog task object and we can’t write many such object because we don’t know how many such task required for each request.

So “how can we achieve this” , the best way to use “Run Script”  and write GlideRecord code on sc_task table , copy all sc_task parameter from previous ( or first) task and link with the RITM. 

and in last, before closing the RITM , apply the code for checking “if all tasks closed or not” if not then apply  wait condition. 

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

View solution in original post

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Cat 

 

Greetings!!

 

I am not a coder but you need to update the flow. As of now its same loop, so what you need to 

 

- When task get closed

- Check is further development is true / false

- If True

Create new task

- If false, 

- Move forward.

 

@AshishKM  @Sandeep Rajput your expertise needed.

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

AshishKM
Kilo Patron
Kilo Patron

Hi @Cat,

First of all, do not plan for unlimited tasks.

Second, in workflow if you point the same catalog task object, it will re-open.
So the “unlimited” option not feasible with single catalog task object and we can’t write many such object because we don’t know how many such task required for each request.

So “how can we achieve this” , the best way to use “Run Script”  and write GlideRecord code on sc_task table , copy all sc_task parameter from previous ( or first) task and link with the RITM. 

and in last, before closing the RITM , apply the code for checking “if all tasks closed or not” if not then apply  wait condition. 

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution