Jira Automation Add a component when any of a specified list of labels are added

Larkin Rogers April 23, 2021

Hello, when a user adds a label from a specific set of labels, either at creation or when editing, then I want a specific component to be added. I dont want to remove any existing components.

I added how I have the automation rule set up, but it is not even registering on the log when I change a label.  ThanksJira Rule.JPG

2 answers

2 accepted

2 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 23, 2021

For the issues where you are testing this, do those issues have any Component value already or is the field empty?

Your condition on the Component field will apply only if the Component field has at least one value. If you want it to apply to issues that also have no Component values at all you will need the JQL to be this:

component !=CS or component is empty

Larkin Rogers April 23, 2021

the component field is sometimes empty and sometimes not.  Ill updated the search to look like this now:

Jira Rule2.JPG

But I am getting this error: SUN-5232 (Field 'components' cannot appear in both 'fields' and 'update')

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.
April 23, 2021

That error is because you have both selected the field above and used it in JSON below.  Please try to deselected in the list above, or use the method I noted to add new values after copying the existing ones (so you would remove the JSON.)

Like Trudy Claspill likes this
Larkin Rogers April 23, 2021

 I deleted the action out and rebuilt it and it now works.  Thanks

Larkin Rogers April 23, 2021

Thanks Trudy, really helpful, got it working with you and Bill's inputs. I really appreciate you all

Like Bill Sheboy likes this
0 votes
Answer accepted
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.
April 23, 2021

Hi @Larkin Rogers 

Have you tried the method where you first copy from the issue and then add the new value?  Please look here for details:

https://support.atlassian.com/jira-software-cloud/docs/edit-issue-fields/#Editissuefields-Addvaluestomulti-selectfields

Best regards,

Bill

Larkin Rogers April 23, 2021

Bill, that was it, thanks.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer