Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create same number of labels from text custom field with multiple values

Nena Kruljac
Contributor
July 17, 2024

 

 

Hello,

How to create same number of labels from text custom field with multiple values?

Example: custom field Domain contains these values: aaa,bbb,ccc 222,ddd - these 4 domains should create 4 labels

It should work in various cases of updates in Domain field:

  1. 1 domain is added to custom field - 1 new label

  2. multiple domains are added to custom field - multiple new labels are added

  3. 1 or a few domains are removed - appropriate labels are removed

  4. 1 domain is added to custom field, other domain is removed from custom field - appropriate domain is added and removed

I tried with smart values in automation rules, but with no success. ChatGPT wasn’t helpful.

Thank you, best regards, Nena

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.
July 18, 2024

Hi @Nena Kruljac 

For a question like this, please post 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 explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

Are there other values in your labels field, or do they only match the values from your custom field, Domain?

If they match exactly, why duplicate the information?  Regardless of that, the values could be used to completely replace the labels values.

If there are possibly additional values in labels, unrelated to the Domain values, your rule will be a bit more complicated, and could use the fieldChange smart values: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange--

There are specific ones for added and removed values that could be used with the Edit Issue labels field to add / remove them.

Kind regards,
Bill

Nena Kruljac
Contributor
July 22, 2024

Hi @Bill Sheboy ,

sorry, I didn't provide all the details (because I supposed that the idea / my question might be "blurred" / lost in too many details).

Yes, there are other labels and they might be used in the future for any other purpose, since anybody can use it anyhow.

Reason for duplicating information: - sync with Jira Align:

1. there is a Jira Align custom field (multivalue) Domain 

2. we will sync it to Jira custom field Domain - scripted field - text (from Adaptavist ScriptRunner)

3. this scripted field should be synced to Labels, that can also contain other values (not only values from Domain field)

4. Jira Labels should be synced back to Jira Align tags

5. These Jira Align tags can be used for filtering work items, where Domain custom field can't be used

If Jira Align custom field Domain could be used for filtering work items, we wouldn't need all this.

I'll try with the fieldChange smart values. Somehow my googling didn't find it :-(

Jira custom field Domain will be used also for boards, not only in labels returning back to Jira Align.

Thank you very much, best regards, Nena :-)

Like Bill Sheboy likes this

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