Hey, Im new to Automation and Im still trying to figure out how to use branches correctly.
I have 5 Components in Project A, each Component has its own Lead.
Now I would like to create an issue every 3 months for every component from Project A in Project B and automatically assign it to the respective Component Lead.
So every 3 Months Project B will have 5 new Tickets, each assigned to the Component Leads of Project A's Components.
Hi @Bent Möller -- Welcome to the Atlassian Community!
Branches in automation rules can iterate over issues or arbitrary things with an advanced branch (e.g., some list of text values). However they cannot iterate over the set of Components defined in a project as there is nothing built-in to get them.
So, some work-arounds are...
If your list of components is stable, you could hard-code them into a created variable, and then iterate over them. For example, let's assume you have a variable named varComponentList with your components as a CSV list:
component A, blue, red, green
Then the advanced branch source could be: {{varComponentList.split(", ")}}
Better still, a lookup table could be used, storing the component as the key and the account id of the lead as the value: https://community.atlassian.com/t5/Automation-articles/New-Automation-action-Create-lookup-table/ba-p/2311333
But that is a brittle solution, as the rule will need updates as things change. To make this more dynamic, the rule could call the REST API function to get the current list of components, and their assigned leads, using the Send Web Request action. The {{webResponse.body}} could then be iterated over to create your issues using the advanced branch.
To learn more about this technique, here are some references:
Kind regards,
Bill
Hey Bill,
thank you very much for your answer and your suggestion. I kept trying yesterday and couldnt find a good way. I also thought about hard coding it, but the 5 Components was a simplification, in the end it will probably be at around 200. I thought about using the Components for Permissions to have the Component Lead as the responsible person for the permission, but I guess it just wont work that way.
I will probably look into realising it via Scriptrunner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With that additional information, perhaps ScriptRunner will be better.
Automation rules can process up to 150 issues / things in a branch (or 50 objects for assets), and so an advanced branch could not span 200 components: https://support.atlassian.com/cloud-automation/docs/automation-service-limits/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thats a really helpful link, also for potential future tasks, thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is another good one in that area: after the packaging changes for automation, they modified what counts toward monthly usage.
https://www.atlassian.com/blog/announcements/cloud-automation-packaging-update
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I'm a teammate of @Bent Möller . I understood the limitations of automation and created a Scriptrunner script.
Basically, this works wonderfully, but unfortunately it also reaches its limits very quickly due to the Atlassian restrictions, namely the 240-second limit.
Unfortunately, I ended up with more than 200 components. The script manages to create around 220 issues before the script is terminated.
Are there any other ideas on how this requirement could be implemented?
Many thanks for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Matthias Schulz -- Welcome to the Atlassian Community!
Another possible approach would be to use the REST API to get all the components, and then create a CSV import file to create the issues. That has a limit of up to 1500 issues and Atlassian will manage the throttling behind the scenes (over about an hour, according to their documentation).
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.
Hello @Bill Sheboy,
I understand your approach, but manual intervention is then necessary. I have now integrated a pagination for the script and create a corresponding number of scheduled jobs with the appropriate parameters for the start page and the maximum number of values.
I know this is not an optimal solution, but one that works once set up without having to intervene manually.
Best
Matthias
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.