I have a 'ticket creation' flow that runs like this.
When a new email arrives, check the subject to see if it contains #VS
If it does not, create a new task, with various updates, the main one being to append #VS and some numbers to the start of the task title.
If the email does contain #VS then I check against all the titles of my current tasks to see if the #VS number matches and if so, I update the description.
However, I want the fall back that if the #VS number DOESN'T match (or it just happens to have #VS in the name) a title, then I want to create a new ticket with a new set of variables.
Currently if I do this, it creates numerous copies of the new ticket for each open ticket I have.
I have seen various similair posts but can't make the resolutions work around my flow.
Solved! Go to Solution.
@VanillaBear thanks for the screenshots. I would suggest to do following.
1. Add Initialize Variable action in just after the "when new email arrives" trigger (before the condition). Name variable as CreateTask, its type should be boolean and set its value to true from Dynamic Content -> Expressions
2. Then under the following shown Yes branches add Set variable action and set the value of CreateTask variable and for value select false from the dynamic content - > Expression
3. Now under the Yes branch of the main condition after the apply to each condition add Condition action. Here in this condition action check value of CreateTask variable to check if its true, then under Yes branch of this condition, add Create task condition. (please note here that you add new condition action after the apply to each action but still the condition should be under the Yes branch of main condition)
The issue that you are currently facing that "it creates numerous copies of the new ticket for each open ticket I have.", it is because you are putting Create Task action under the condition which is under the Apply to each action, apply to each action will run X number of times, where X is the number of open tickets. So following above steps will resolve the issue.
@VanillaBear can you please share the screenshot of your workflow?
Apologies @annajhaveri , last time I tried to insert screenshots I was unable to!
Overview
Two screenshots for the if Yes expanded
@VanillaBear thanks for the screenshots. I would suggest to do following.
1. Add Initialize Variable action in just after the "when new email arrives" trigger (before the condition). Name variable as CreateTask, its type should be boolean and set its value to true from Dynamic Content -> Expressions
2. Then under the following shown Yes branches add Set variable action and set the value of CreateTask variable and for value select false from the dynamic content - > Expression
3. Now under the Yes branch of the main condition after the apply to each condition add Condition action. Here in this condition action check value of CreateTask variable to check if its true, then under Yes branch of this condition, add Create task condition. (please note here that you add new condition action after the apply to each action but still the condition should be under the Yes branch of main condition)
The issue that you are currently facing that "it creates numerous copies of the new ticket for each open ticket I have.", it is because you are putting Create Task action under the condition which is under the Apply to each action, apply to each action will run X number of times, where X is the number of open tickets. So following above steps will resolve the issue.
Hi @annajhaveri , thank you for your help, but you have lost me.
I have added in the initialize variable here
But point 2 and point 3 are confusing me.
Can you run through these step by step please?
@VanillaBear okay lets go step by step, lets first do step 2
Under the action "Update task details 2" click on add action button as shown in below screen, and add Set Variable action
The set variable action should look like below
Thank you 🙂 That is done!
@VanillaBear great, for step 3, now do you see Add an Action button under the "Apply to each 2" action, it will appear similar to below screenshot, click on that add an action button and add "Condition" action
Now configure the condition action as shown below:
Thank you! I have done that.
So now I just create the task how I would like it to appear under the 'Condition 3' If yes variable?
@VanillaBear yes thats correct
Thank you so much for your help! Much appreciated. I will test it out over the weekend!
User | Count |
---|---|
93 | |
45 | |
19 | |
19 | |
15 |
User | Count |
---|---|
137 | |
54 | |
42 | |
42 | |
30 |