How to set a label based on a 'custom field single drop down'
Asked by Rickhi.Seecharan:

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.


Answers:
author: Mark Segall
body: Hello [@Rickhi.Seecharan](/t5/user/viewprofilepage/user-id/4859966) and welcome to the community!

You can do it with something like this:

![2022-04-05_08-54-29.png](https://community.atlassian.com/t5/image/serverpage/image-id/191637i9A66C2B5141B31EE/image-size/large?v=v2&px=999 "2022-04-05_08-54-29.png")

![2022-04-05_08-57-55.png](https://community.atlassian.com/t5/image/serverpage/image-id/191639iC88606C0506874DC/image-size/large?v=v2&px=999 "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.


author: Curt Holley
body: Hi [@Rickhi.Seecharan](/t5/user/viewprofilepage/user-id/4859966)   
Certainly [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637) 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*."

comments: author: Rickhi.Seecharan
body: 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.


author: Curt Holley
body: 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?


author: Dylan Kogut
body: [@Curt Holley](/t5/user/viewprofilepage/user-id/3527535) 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.


author: Rickhi.Seecharan
body: This is also what I am trying to accomplish. Thanks Dylan.


Tags: cloud