I have a custom Field of type "Checkboxes". There I can select multiple Items from a list (predesigned steps that need to be done. E.g. Step1, Step2, Step3). When I add a new item to the checkbox, I would like to have an automation rule that automatically adds a Subtask for every selected step with the description "Conduct Step1".
I created an automation Rule that checks the custom Filed for values to be added.
With {{fieldChange.toString}} I get a String of all currently selected boxes.
Now I have to problems:
* How to seperate this list and create multiple subtasks --> currently it creates one subtask with the whole list a s a string
* How to check that the subtask does not already exist and a duplicate is created
Hi @Johannes Mayr -- Welcome to the Atlassian Community!
You could use an Advanced Branch, over the selected values of your checkbox field, and add a subtask for each one.
Please look here to learn about using Advanced Branches: https://community.atlassian.com/t5/Automation-articles/Branching-over-smart-values-in-Jira-Automation/ba-p/1741935
Also note that this type of branch executes in parallel for performance reasons, and so there is no guarantee of the order your subtasks will be created.
Regarding your question about preventing duplicates...That is a bit more complicated.
You could use Lookup Issues to first gather the current subtasks. And then inside of the branch, use a condition to confirm the subtask does not exist before creating it. Or you could just check the {{triggerIssue.subtasks.summary}} values, as that is already loaded.
And so an outline of your rule could be...
Kind regards,
Bill
Hi Bill,
thanks for your reply. I currently try to implement a simplified version that does not yet check for dublicates, but I'm struggling with the advanced branching function.
As suggested by the "When: Value changes for" block I used {{fieldChange.toString}} to get a list of the changed values of the checkbox.
Then I assign Summary field with {{WorkProduct}} in the "Then: Create a new" block.
This works so far, but I do only get one new subtask that has the whole list of selected items in the summary. So the "loop" does not work and is only executed once.
How to manage that my list is correctly iterated in the list?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The {{fieldChange.toString}} smart value will just be text, and not a list of values.
Your two options are to use the split() function on any commas or to specifically use one of these smart values:
{{addedFieldChange.valueIds}} or {{addedFieldChange.values}}
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange--
The specifics will depend upon how you are trying to use those in the create issue action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy - apologies for asking on an old post but I cam across this and I think it may be applicable to what I am trying to do also, however I have been trying to play around with this but I cannot seem to get it right.
The issue is that the other sub-tasks are still getting created so there is probably an issue with the "Lookup issues" and "Compare values".
I tried JQL of parent = {{triggerIssue.key}} and summary = your branch variable but I got this error -
Custom Smart Value JQL Search: "(parent = INC-930 and summary = Department) AND (project in (10047))" - The operator '=' is not supported by the 'summary' field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As you note, this is an older thread, and so I recommend creating a new question and linking back to this one. That will ensure the maximum number of people see it to offer suggestions.
Back to your question...
When using a variable like you show in the JQL, the smart value must be enclosed in the curly brackets, like this:
parent = {{triggerIssue.key}} AND summary ~ "{{Department}}"
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Drishti Maharaj had already started a new Question before adding to this post. The new Question is here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Bill Sheboy your answer helped me out. Managed to get the automation working as it should now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.