Smart value with concatenate string in string replace/replaceAll

Masudur Rahman April 28, 2020

Hello
How can I do the following.

{{issue.description.replace("found text", "replace text with smart value:"+createdIssue.key)}}

Basically I want some text should replace with smart value and plain text as concatenated.

Thanks
Masud

2 answers

1 accepted

0 votes
Answer accepted
Bloompeak Support
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 29, 2020

Hi @Masudur Rahman ,

Below worked on my Jira. I hope it works for you too.

{{issue.description.replace("found text", issue.summary).concat("my plain text")}}
Masudur Rahman April 29, 2020

Thank you , But can we have the following instead of suffix, I want prefix concat.

{{issue.description.replace("found text", "my plain text".concat(issue.summary))}}
Bloompeak Support
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 29, 2020

As far as I checked there is no prepend function. But you can have the same behavior with the below snippet..

{{issue.description.replace("found text, issue.summary.left(0).concat("my plain text").concat(issue.summary))}}

Above the prepend behavior is done

  • first by creating an empty string
issue.summary.left(0) ==> returns empty string
  • then concat the prepend text to the empty string
issue.summary.left(0).concat("my plain text")
  •  finally concat the smart value
issue.summary.left(0).concat("my plain text").concat(issue.summary)
Like # people like this
Masudur Rahman April 29, 2020

Thank you very much @Bloompeak Support 

It worked :)

Like Bloompeak Support likes this
Vladislav Penkovskiy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 25, 2022

Thank you, that was really helpful! 

Like Bloompeak Support likes this
0 votes
Chad Waldman February 5, 2023

I first create a new variable with the value:

my plain text{{issue.summary}}

Then when I set my field, I can use the smart value

{{issue.description.replace("found text",myVariable)}}

Suggest an answer

Log in or Sign up to answer