How to replace for string one part to another with Jira Automation

Степан_Сычёв February 5, 2020

I have tried to catch EPIC link for an Issue like this:

{{#debug}}
{{issue.toUrl.replace(issue.key,issue.customfield_10006)}}
{{/}}

 customfield_10006 - Epic Link (epic issue key)

 

I always get an empty result in debug. What should I do to get it?

3 answers

1 accepted

0 votes
Answer accepted
Cristiano
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2020

Hey Степан_Сычёв,

Thank you for contacting the Atlassian community. My name is Chris and I'll be glad to help you with this :D 

Sorry for the delay in this first comment. we have been migrating from Code Barrel to Atlassian, and because of this, you've had waited to support more than normal, sorry about that.

First of all, I'd like to understand if you need to replace the issue key into the URL with the issue key from the customfield_10006. I'm afraid that this is not possible, with this in mind can you give more information about the expectation and about your scenario to think into the best solution if it is possible.

Furthermore, our recommendation is to use this link to open an issue with Atlassian. Into Atlassian team, there are more people working to support you and I'm pretty sure that they will help you faster :D BTW I work in that team. Also, into this link below, you can select the priority.

Link to support: http://go.atlassian.com/a4jsupport 

Besides, into this new ticket, if you want you can answer my question there, no worries, only comment that you've talked with Cristiano Fontana, and we'll continue to support you :D 

Looking forward to this information.

Cheers,

Chris | Atlassian Cloud Support

Степан_Сычёв February 17, 2020

Good day, Chris! Thank you )

My point: I need to send a HTML email when issue transitioning to specified status. Let it by 'READY'. I created a transitioning trigger and need to paste in the email some info. Something like that:

This issue of Epic (PROJECT-123) were transition to status 'Ready'. You need to check it.

And I need to PROJECT-123 be a HTML link to the PROJECT-123 issue.

What have I got:

1. issue.toUrl() - functuion, return url string of issue, looks like "http://server-jira/.../PROJECT-2"

2. issue.customfield_10006 - epic key, looks like {  ..."customfield_10006 " : "PROJECT-123", ... }

What have I done:

3. I tryed to replace one part to another..

{{issue.toUrl.replace(issue.key,issue.customfield_10006)}}

but it does not work

Cristiano
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 18, 2020

Hey Степан_Сычёв,

Thank you for your reply!

It seems that the best solution for your scenario is using this structure below into the email action:

https://<YOUR_JIRA_INSTANCE>/browse/{{issue.customfield_10006}}

send email.png

With this code above you'll add the value of the custom field into the end of your URL.

Can you give a try and let me know how it goes?

In case of further questions let me know!

Have a wonderful week ahead :D 

Cheers, 

Chris | Atlassian Cloud Support

0 votes
Cristiano
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2020

Hey again,

I hope you're doing well.
We just wanted to quickly hop in here and check if you successfully received our last reply.

Customer satisfaction is most important to Atlassian so please let us know if you need our help.

Your followup is extremely appreciated.

In case of further questions count on us.

Cheers,
Chris | Atlassian Cloud Support

Степан_Сычёв April 3, 2020

Thank you!

Your advice helped me. It's work. But not the way I would follow )

Replace function still not work as well (

0 votes
Степан_Сычёв February 13, 2020

Anybody??

Suggest an answer

Log in or Sign up to answer