Use automation to make a Continent country relationship for two different fields

Gustavo Polo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 29, 2024

Hello everyone.

I want to create a automation that will do the following:

User can select one or more "continents" in field A (a checkbox field type)
The automation would validate that and edit field B (another checkbox field type), adding the "country" info.

Currently I am able to add the values in field B based in only one selection in the field A, if another value in A is chosen, it removes the previous values in B.

I would like to make the values in B stack, based in the field A selection

As a nice to have, I would like to have this (or another) automation to remove the values in B, in the case that the equivalent value was removed in A.


I tried to do somethings with smartvalues in the "additional fields" but nothing worked based in the similar situations I have found in the web and my smartvalues are not there yet.

I appreciate the help 

3 answers

1 vote
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.
November 29, 2024

Hi @Gustavo Polo -- Welcome to the Atlassian Community!

For a question like this, context is important for the community to help.  Please post the following:

  • what type of project is this (e.g., company-managed, team-managed, etc.)
  • an image of your complete automation rule
  • images of any relevant actions / conditions / branches
  • an image of the audit log details showing the rule execution, and
  • show an example of your issue with the checkboxes.

Until we see those...

I am unclear on how your rule flows, as selecting the Continent first may be insufficient information to then select the Country list.  Seeing your example issue and rule will help clarify things.

 

Are those the built-in checkbox fields or from a marketplace addon?

 

When you are trying to add / remove multiple values for this type of field, you will likely need to use advanced edit with a dynamically built JSON expression.  This would use the field changelog from the rule trigger to build something like in this documentation:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Checkbox-custom-field

 

Kind regards,
Bill

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.
November 30, 2024

@Gustavo Polo -- Please try to stay with one thread when responding.  That will help people reading the question know if there are multiple solution approaches to try.  

 

Thank for the answers and rule images.  And please refer to my earlier answer where I noted the JSON must be dynamically generated.  This would maintain the current values and add the new ones.  Similarly, when values are deleted they could be removed, using the changelog to decide what is to be removed.

And as @Tomislav Tobijas _Koios_ describes, using Assets may be better for your scenario as all of the Countries for a Continent are added as a static list you have created.

0 votes
Gustavo Polo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2024

Giving a little more of the insights.

This is for a Jira software project, for company managed projects.

The field A and B are custom fields with specific contexts.

When I select Americas, it fills the countries

image.png


When I choose another one, I would expect it to stack in the countries, but the behavior it gets is to remove the previous ones and only the last if in the automation applies

image.png

Here is the sample of the automation rules

image.png

now the logs

image.png

As per @Bill Sheboy 
I understand that smartvalues like this
"customfield_11440" : [{ "value" : "option1"}, {"value" : "option2"}]

Would cause the same behavior as add but overwrite

as per @Tomislav Tobijas _Koios_ 
I believe this asset is not what I am looking for


0 votes
Tomislav Tobijas _Koios_
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
November 30, 2024

Hi @Gustavo Polo ,

On top of what Bill said in his reply if you're using JSM Premium you can achieve this by using Assets custom fields. Usually, admins switch from having tons of custom fields to simply managing relations via Assets object linking and referencing.

Anyway, here's one example of how this can be configured: Can an Asset Custom Field dynamically change it's values based on another Asset Custom Field value? 

Cheers,
Tom

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events