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
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:
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:
Kind regards,
Bill
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
Here is the sample of the automation rules
now the logs
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.