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

Using variables in functions in smart values in JIRA for automation purpose


I'm looking to use jira automation rules in an advanced way using variables in smart value functions.

I saw that a ticket covered this topic some time ago but even though it is marked as resolved I am having trouble applying the syntax.
Here is the ticket :

I want to do the same, e.g. :
{{issue.summary.replace("blah", "{{issue.fields.reporter.displayName}}")}}

Is there a way to use variables in smart value functions?


1 answer

1 accepted

1 vote
Answer accepted

Hi @Julien Robert 

Yes, that works.  If you remove the quotation marks and extra curly braces that would work.  For example:

{{issue.summary.replace("blah", issue.reporter.displayName)}}

Best regards,


Hi @Bill Sheboy 


Thanks a lot for your answer.

I tried to combine your solution with a variable added by "Create variable" 

Image 111.png

But I failed to use this variable in the replace method. This didn't return anything using the variable whereas it did return something when I directly used values ​​like fieldChange.fromString and fieldChange.toString (the trigger of my action is a change of a field)

Instead of using a custom variable, I used a way to concat "[" and "]" with another topic (

Here is my final code that do what I want to do :

"fields": {
"summary": "{{issue.summary.replace(fieldChange.fromString.left(0).concat("[").concat(fieldChange.fromString).concat("]"), fieldChange.toString.left(0).concat("[").concat(fieldChange.toString).concat("]"))}}"

There is probably some way to make it prettier but I stop my search here! 


Thanks again !

Like Bill Sheboy likes this

Hi, and I am glad you got that to work!

Regarding Create Variables, they definitely need some investigation and improvements to be a more useful tool for automation rules.  Currently, I have only found them useful to build JSON strings for complex edits and to remove things from lists (e.g. Components).

Best regards,


Like # people like this

Thank you


Best regards


Like John M Funk likes this

I have discovered a similar issue, where I am unable to use earlier created variables as function arguments in smart values, and the workaround is to use issue entity properties instead:

For some issue, which has at least 6 comments, automation goes as follows...

Create smart variable:
Variable name: commentNumber
Variable value: 5

Set entity property for issue:
property name: prop_commentNumber
property value (JSON):

{"val": {{commentNumber}} }

Log action:


Is it the best approach at this moment, and there is a bug in accessing list elements via smart variable values?

Hey Boris,

Did you figure this out?


Suggest an answer

Log in or Sign up to answer
Site Admin
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,860 views 37 49
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