How to create an issue for every component in a project via automation

Bent Möller March 12, 2024

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.

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2024

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

Bent Möller March 13, 2024

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.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 13, 2024

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/

Bent Möller March 13, 2024

Thats a really helpful link, also for potential future tasks, thanks!

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 13, 2024

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

Like Bent Möller likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events