How do I use a radio option custom field selection to automate labels?

Drew
Contributor
April 6, 2022

I am trying to set the label on a newly created issue to be the value of a selected radio option of a custom field. The automation rule I am using is shown below (the "if" condition is so that it only works if I submit it, for testing purposes.) This is my latest attempt. I have tried about 10 different ways using a smart value, but I still end up with empty labels every time.

I have tried using both the custom field ID and the name of the field. I've looked through documentation as well, but so far have come up empty.

Is it possible to use the selected radio option of a custom field? If so, would someone be able to show me the correct way to do it?

I could always do a collection of "if" statements and do it that way, but I'd rather do it this way if possible. This is so that the labels would be dynamic if we ever change the radio options in the custom field we're using

image.png

2 answers

1 accepted

2 votes
Answer accepted
Joseph Chung Yin
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 6, 2022

@Drew -

Hi Andrew:

A few things you should check -

1) Your smart value syntax looks odd.  What is the actual custom field name?  The smart value syntax should be something like - {{issue.<the name of your custom field>}}.  Please see smartvalue reference link - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

2) In regards to the Labels field, you need to know that by default value for this field cannot contact spaces.  So if your custom field value contain spaces, then the labels field will display the one value as two separate values for the Labels field.

3) Please validate that your Edit Issue action is setup correct.  Example I have an Edit Issue action where I want to copy the value from the current issue's field into my "Labels" field -

2022-04-06_15-37-23.png

2022-04-06_15-38-30.png

Lastly, I am not aware of any limitation in automation for Jira rule setup against a radio button custom field.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

Drew
Contributor
April 7, 2022

@Joseph Chung Yin Hey Joseph,

In this case, the custom field's value name is "IssueCategory". I attempted using a "Test" label in this format, which worked:

image.pngIf I change this from "Test" to "{{issue.IssueCategory}}" (double quotes included) or "{{issue.fields.IssueCategory}}", it does not work as expected and I end up with empty labels. The value of the radio option I've been testing with is "Email".

I'm beginning to think it may have something to do with one of the extensions we are using, since it allows for dynamic field configurations on our request types.

I'm probably just going to use an easy button here and create different "if" statements for each radio option. This response was still very informative and confirmed how I should be entering the smart values, so thank you for responding!

Maybe this is not a question for you, but should I accept a response as an answer if I end up abandoning the goal I was attempting to accomplish?

Joseph Chung Yin
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 7, 2022

Hi Drew:

Using the the if statements make sense.  Yes, if you think my suggestion help, then please accept the response as an answer.

Best, Joseph

1 vote
Mark Segall
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 6, 2022

Hi @Drew 

Try this... 

{{issue.<custom field name>.value.replace(" ","_")}}

Note - the replace function is optional.  I have it there in case the selected option has a space.

Drew
Contributor
April 7, 2022

Unfortunately using this format did not work for me :/ I am beginning to think it is an issue being caused by one of our extensions

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events