My problem statement is as follows:
I need a repeating pattern in which that requires 4x stories but these need to be created multiple time for multiple teams and all of these stories link back to the same epic.
Whilst the descriptions, acceptance criteria, notes etc have the same value for each of the 4 stories there is a variance in that each teams stories have distinct value associated with them for the stories assigned to their backlogs being:
For each component there could be maximum 12 stories (4x priority = Highest, 4x priority = Medium and 4x priority = Lowest) or there could be just 4x if only one priority applies
The priority is set from epic component value e.g. Service (Primary), Service (Secondary), Service (Tertiary)
This is a repeated pattern. I could create very long automation rules that have many duplicate instances of 'Create a new story' but I'm sure that I could automate this more efficiently using a rule to call another rule or branching etc. BUT I can't fathom the right approach.
So basically at its simplest:
I have proven out the rule for one team and one set of 4x user stories to ensure generation of story content is correct (see attached image).
Any help, advice, direction would be greatly appreciated please?
Step one: make it work. Step two: make it "better".
You are on a good track that a long, simple rule could solve this, and you could do that with an advanced branch over a list of teams (either from the epic or from a created variable), and then use conditions on the component to add either 4, 8, or 12 stories per team. That rule will be about 30 rule steps (components).
Once that works, you could try a shorter, more complicated rule. I recommend saving your working rule before trying this with a copy of the rule.
Unfortunately it is not possible to nest branches within each other in rules to simplify writing this rule. Maybe they will add that feature in the future.
And watch for this...rules like this which do a lot of work can run a long time. That could lead to throttling, rule halting, and exceeding your execution time limits per hour. Check the stats to observe what is happening.
Kind regards,
Bill
Hi @Bill Sheboy
Thanks for your quick response, positive feedback and suggestions on breaking down the work for my problem statement.
Working through the long simple route I pivoted away from use of teams and chose to iterate on the values in the Epic components field instead; of which I then implemented an advanced branch over that variable as suggested.
I have one outstanding issue at then end of this reply but this is where I went before I got to that:
My next challenge was to find the correct index position of the component value to add to each story description and component
I then referenced this in each user story as follows
BUT I could not for the life of me work out how to increment the componentIndex value by 1 to return the next index position using list 'get(foo)' to return the next component.name value in the list.
Then I realised that all I needed was to use the advanced branch smart value {{componentName}} instead as this was already being iterated. Dur!
As I type this I've yet to remove the now redundant 'Create Variable and Set Entity Property' components prior to start of the advanced branch
So a great result in the end, learning some tricky bits as I went :)
However I am unable to work out how to set the user story priority based upon the {{componentName}} value as iterating through the advanced branch (as per yellow circle in picture above)
For example:
On the {{componentName}} I can't work out how to:
Its not clear what smart value properties Priority has ? Is it only {{issue.priority}} ?
Also I assume some JSON code is required but cannot see which automation component to use that would allow me to parse/pattern match for primary etc and also set the priority value.
IS this a combination of creating a smart value variable and set entity property - but if so how do you update this as the {{componentName} iterates in the advanced branch?
Any advice would be greatly appreciated please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First thing: well done figuring this one out!
Okay, you are on track with the approach of creating a variable and using that to set the priority. Unfortunately, variables cannot be used in smart value, list filtering (which would make this easy.)
Just to confirm your use case, which of these applies:
(A) based on the epic's components, the SAME priority will be used for all of the stories, with the highest possible priority winning out
(B) each set of stories will have a potentially DIFFERENT priority based on the specific component accessed within the branch
For case (A), I would determine the priority before the branch, make a delimited list of priority|componentName pairs, and then split that for the advanced branch iterator, which will then assign within the branch by splitting apart the pair of priority and componentName.
For case (B)...two possible work-arounds inside of the branch are:
{{componentName.replaceAll("EKS (Primary)", "Highest").replaceAll("Landing Zone (Primary)", "Highest")...
Once you have varPriority set, in the Create Issue action select the priority field and type in {{varPriority}} and the smart value will appear below the field. Select it so it is used.
Please note: I believe you need to set the id value for priority to edit in this way, but perhaps try the name first to see if it works.
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
Its use-case (B) where each set of stories (under the same epic) will have a potentially DIFFERENT priority based on the specific component accessed within the branch e.g.
Q: How can this be done when you can't use if/else inside a branch?
Should I create the following 'create variable' component before the advanced branch e.g.
Of course this means I'd need to code every different distinct component into the automation BUT if the advanced branch is iterating on the smart variable {{componentName}} inside the branch how can I iterate in parallel for the {{varPriority}} equivalent?
What I have noticed is that under Create Issue component the 'Priority' field does not seem to allow Smart Values to be entered :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My mistake: I recalled there was a hack that allowed creating the if/else and dragging it into a branch, but I just retested and that is not possible now.
For the second approach, no: create the varPriority variable inside of the branch. You note that the priority can change by component. If we assume the epic has multiple components the priority is dynamically determined inside of the loop.
The varPriority variable create would try to replace each possible component name to determine the priority. But there should only be one match per component, and so only one priority value.
To use that value for the priority field in Issue Create...
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
After getting my head around how the following assignment properties behaved; and using ID value as the replacement instead of priority name e.g. "Highest"
Plus assigning {{varPriority}} to the Priority field as you stated - it all worked!!
I was able to copy the same process above but to identify & assign Jira Portfolio Teams through a custom value in the JSON script of each create issue.
Thank you so much for your help and guidance. A great result and learned alot more about the nuances of automation scripting
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well done, and I was glad to help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.
Register here ⬇️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.