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
Community Members
Community Events
Community Groups

Convert text in custom field to label with retaining existing labels


Hi there,

I'm attempting to finalize the setup of automation that will convert the text within a custom text field into a label and add it to the existing labels on an issue. 


When I attempted to accomplish this feat, I've been unsuccessful but have been scratching my head with the syntax error I believe I'm facing. For those finding this in the future, maybe this will be helpful:


"fields": {
"labels": [
"{{issue.customfield_1111111.replace(" ","_").replaceAll("["$&+,:;=?@#|'<>.^*()%!-"]", "_")}}"

1 answer

Hi @Jay Dubinsky ,

Welcome to the community! Hope you like it here and glad you're using labels – in my mind one of the coolest features of Jira.

Setting labels with Automation is not as straight-forward as one might want, but ultimately not too bad. I'll assume that you already got your trigger set up and are just looking for a way to add the label. Here's the what that would look like:

Bildschirmfoto 2022-08-12 um 13.25.15.png

The important thing to note here, is that you'll need to include the current labels with this line:


Of course, instead of using a smart value to grab part of the summary, you'll want to get your custom field.

Hope that helps,

Thank you so much Oliver, this was helpful! 


I was able to clean up some syntax issues I was running into so this was extremely helpful!

I forgot one small piece to this: the text field in use has spaces in between the name and I need to convert those to underscores to be accepted in a label. 

Below is the code I'm actively using without success:


Screen Shot 2022-08-12 at 11.35.12 AM.png


I sincerely appreciate all of the help! I'm just a bit puzzled on this one. 

Hi @Jay Dubinsky -- Welcome to the Atlassian Community!

Two things of note:

Please try the replace() function to substitute your spaces for underscores:

And, when using the edit issue action, either select the field (from the dropdown) and enter your smart value expression, or use the advanced edit with JSON.  Do not try to use both for the same field, Labels.

Kind regards,

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events