JMWE: How to add base url in email post function / URL to issue

Jonathan Chatwin July 15, 2020

Anyone out there used a groovy base url in an email post function? Or is there an easier way to link to the issue

I want to use Base URL so that when I promote changes from environment to environment I don't have to change the uatjira/devjira/jira part of the URL.

What I have is this:

<code>

Click the link below to open the work request in Jira.<br>
<a href="<% ComponentAccessor.getApplicationProperties().getString("jira.baseurl") %>"/browse/${issue.key}>${issue.key}</a>

</code

 

I must be missing something easier!!!!

1 answer

1 accepted

3 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 15, 2020

How about using:

issue.url

This is part of JMWE's simplified API, and it's visible on the "Issue Methods" help tab (in the "Others" section). 

Jonathan Chatwin July 15, 2020

Too easy. Thanks. 

Michael Goulette July 19, 2023

Would this work for linking back to the original issue that was created?

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2023

Hi @Michael Goulette 

what do you mean by "the original issue that was created"?

Michael Goulette July 19, 2023

Hey @David Fischer 

We have set up a post function that includes an email sent to the reporter when an issue is created. I was wondering how to insert the link to that created issue into the email that is sent to the reporter?

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2023

The same way that was documented before. Just make sure you move the Email Issue post function to the bottom of the list of post functions on the Create transition.

Unless you're on Jira Cloud?

Michael Goulette July 19, 2023

We are on jira data center. So i would just need to insert issue.url into that email?

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2023

More specifically, ${issue.url} to insert the URL, but if you want to show the issue key and make it into a clickable link, you could do

<a href="${issue.url}">${issue.key}</a>

(in the HTML body)

Suggest an answer

Log in or Sign up to answer