Hello,
I am attempting to create an automation that generates a number of sub-tasks equal to the amount of selected components. More specifically, there is a parent ticket in which the reporter can choose multiple countries relevant to the issue. Once the parent ticket is submitted, the automation process is triggered, generating separate sub-tasks for each of the selected countries. This allows for automatic assignment of these sub-tasks to the appropriate individuals who are the component leads for their respective countries.
Any ideas on how to implement this rule?
Hi @Anett Hunt ,
The general approach to iteration in automation rules is to use branching.
In your case you would probably want to use the "Advanced Branching" component, which lets you use a smart value expression to select the multi-select field you want to iterate over.
I put together a PoC that just logs out the selected options in the field, but that could easily be extended to create tasks etc.
https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/#Advanced-branching
Hope that helps.
Thank you, @James Navin - your response could be the winning solution! I've managed to create sub-tasks successfully using the example you provided. The only difficulty I'm facing now is how to name the sub-tasks differently based on the selected options. I attempted to use "{{customfield_XXX.value}}" as a smart value, but it ended up listing all options in the summary, as I expected.
Nevertheless, this shouldn't be a huge problem now that I can automatically generate the sub-tasks, all thanks to your solution!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes the naming bit was where I was scratching my head but I seem to recall seeing a discussion if not solution in the community for this but have not found anything in my search.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I figured it out:
Quite a simple solution, but seems to be doing exactly what I needed - each sub-task has a distinctive name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh geez of course. I need more coffee...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Anett Hunt , this is an interesting use-case. I am unaware of a means to programmatically iterate over a multi-select field within Automation. You could use an If/else condition to achieve your goal but if you have a lot of values in your Component list this could be cumbersome. Further maintaining the static rule isn't ideal. There are certainly true scripting addons that could be leveraged.
I am going to peruse the Automation docs to confirm or refute my understanding of iteration logic. If I find that my understanding is lacking I will update here. Others may chime in here as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, @Jack Brickey! If/else was my initial idea too. However, the challenge lies in handling numerous countries...
Let me provide some context for this particular use case: When a product change occurs, a parent ticket is created. The reporter of this ticket selects all the countries affected by this specific change. We need an automation to generate separate tickets for each responsible person handling a specific country. This allows them to work independently on their own tickets, and we can later have the data from these tickets. Without this automation, we might run into a situation where a parent ticket is created, but we can only assign it to one person, making it impossible to track the individual work for each country.
Hope this makes my question a bit more clear!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.