Looping workflow - create new tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2023 03:06 AM
Hi,
I have a change workflow with an approval step that comes after the completion of a change task.
If approval is not granted, it loops back for the purpose of making amendments to that change.
I want the workflow to create a new change task the second time around, but all it does is reopen the existing one.
Any idea how I get it to do this?
Many thanks,
Mark.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2023 06:34 AM
Can you please share the screenshot of the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2023 03:16 PM - edited ‎07-02-2023 03:21 PM
From my experience looping back will always reuse the existing record. A way I solved this was via script (if you would want to allow the users to go through multiple of iterations) or via create task activity. Something like this:
But it also depends on what you would like to do after the second created task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 02:55 AM
I am basically trying to create an approval process using a task - I'm needing more than just an "Approved / Not Approved" response. I need numerous fields completed as part of the approval process before this change progresses which is why I dismissed the normal approval process for this one. I am creating a task containing various mandatory fields, along with an "approved / not approved" question, If it isn't approved, then it is sent back round for the change to be amended. It's very important that if it isn't approved, for the responses to be logged in the ticket, which it currently does, but we could really do with the closed "Not approved" task being left there as evidence of the change ticket's journey before being eventually approved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2023 02:49 PM
As mentioned, if you want to leave the current task as is, you cannot route back to it via the workflow. Unless you have a finite of number of attempts you will probably need to script the task creation (https://www.servicenow.com/community/developer-forum/change-task-creation-via-workflow-script/m-p/19...).
The easier way would to give them a finite number of attempts because in that scenario you can just use the needed amount of 'create task' activity to get that done.