I have two multiple select list fields that I would like to create sub tasks for each option select.
For example what I need:
custom field 1 has the options: a, b, c, d, e
custom field 2 has the options: 1, 2, 3, 4, 5
If "a, c, e" are selected and "1, 4" are selected I'd need the following subtasks:
a, c, e, and, a-1, a-4, c-1, c-4, e-1, e-4.
What I have: 2 different automations (showing 1 below, set up identically but with different smart values) but I'm still left having to manually create some sub tasks and wonder if there is a way to automate it.
With the 2 rules I have now I would get the following subtasks:
a, c, e, 1, 4
Is there a way to iterate the sub task creation over multiple smart values?
Rules do not currently support nested branching (i.e., branches within branches) or nesting list iterators when the values are at the same or higher scope (i.e., two custom fields in an issue). That makes solving this quite challenging, and I'll outline four approaches to help you decide if you want to take on that challenge / risk.
For example, such as a standalone service that can be called from a Jira automation rule using the Send Web Request action.
I can think of three other rule-based workarounds for your scenario, all of which require some degree of hardcoding the custom field values. However, first some questions, and assumed answers:
When these custom field values are set, that produces some period of variability. And so...
A large conditional expression could be created, checking each value in CustomField1 to then iterate the values in CustomField2, building a created variable. The variable may then be split for branching. For example:
{{#if(issue.CustomField1.value.match("(value A)").size.gt(0))}}
{{#issue.CustomField2.value}}value A--{{.}},{{/}}
{{/}}
{{#if(issue.CustomField1.value.match("(value B)").size.gt(0))}}
{{#issue.CustomField2.value}}value B--{{.}},{{/}}
{{/}}
...repeat as needed
Similar to #1 above, but store each entry in a table to improve readability / maintenance. For example:
Create a rule with an incoming webhook trigger, assuming it will only process CustomField1's value A. Branch over the values in CustomField2 to create the subtasks.
Clone that rule N-times, once for each CustomField1 value.
Create a manually triggered rule which will use the Send Web Request action to selectively call each rule:
Kind regards,
Bill
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.