Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,137
Community Members
 
Community Events
165
Community Groups

How to set a label based on a 'custom field single drop down'

Hello

 

I have created a single drop down list.

I would like to automate so whatever value is selected in the drop down list - is automatically created as a label.

this is a global setting for the project, not specific.

2 answers

0 votes
Curt Holley Community Leader Apr 05, 2022

Hi @Rickhi_Seecharan 
Certainly @Mark Segall has covered off the automation beautifully, but what I am interested in is the Why?

If you have a custom field on the screen of the issues that require it.... Why do you need a copy of that as a label? as it would be visible, searchable etc. as is.

The only reason i can think of would be to keep a kind of history of any changes to the selection, so that all chosen (over a period of time) end up as labels. In which case you wouldn't want to do what Mark suggests "consider adding logic for situations where the dropdown has changed so that the old label is removed."

Hi Curt.

I would like it to show up on the ticket in 'Board' view...if its a label, then it shows up  Secondly, its a way of restricting people from creating new labels.

Curt Holley Community Leader Apr 07, 2022

Right, a Jira Work Management restriction workaround. 
Of course if you were doing this in a Jira Software project you could have the custom field on the cards....and to that end,  being able to create and control custom fields (without the need for automation to create a matching label) is an even better way to discourage the overuse/creation of labels.

Is there any reason not to use a Jira Software project for this particular purpose?

@Curt Holley I can say that a team I operate on behalf of is trying to keep things as simple as possible and that is using a team-managed business project. Unfortunately, since you cannot add additional "Quick Filters" on the Board view, the workaround is to replicate whatever the value is in their custom field to a label so they have a way to filter the board and view their issues.

0 votes
Mark Segall Community Leader Apr 05, 2022

Hello @Rickhi_Seecharan and welcome to the community!

You can do it with something like this:

2022-04-05_08-54-29.png

2022-04-05_08-57-55.png

 

Note - I created the variable because I like the ability to tweak the smart value as needed.  Whereas if I applied the smart value directly to the edit issue action, it has to be deleted/retyped.

Secondly, the smart value takes spaces into consideration and replaces with an underscore because labels don't support spaces.

For copy/paste purposes, here's the smart value:

{{issue.Test Selector.value.replace(" ","_")}}

You may also want to consider adding logic for situations where the dropdown has changed so that the old label is removed.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Work Management

Join us for a live demo of Jira Work Management

Interested in learning more about Jira Work Management? Have questions you want to get answered? Join us for our upcoming live demo where we’ll take you through the essentials of Jira Work Manageme...

1,704 views 4 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you