Hi,
I am using ScriptRunner to send an email when an issue is created.
In the email I would like to add a button which links to the issue, is there something like
${issue.description}
but to obtain the issue URL?
Appreciate the help!Joe
Hello @Joe Charman
It should be straightforward, you can get the base URL using
def baseurl = com.atlassian.jira.component.ComponentAccessor.getApplicationProperties().getString("jira.baseurl")
Just append the following to the base_url
complete_URL = base_url + "/browse/" + ${issue.key}
complete URL is the final URL which the end-user can click in the mail and land on the issue.
Thank you Tarun,
I didn't quite get the base url identifier to work, but it's all fixed as I have used the following instead:
<a href="http://URL/browse/${issue.key}" class="button">View</a>Which links directly to the issue.
Thanks for your help, - Joe
Glad to know that it's working, please accept/upvote the answer so that others are helped as well.
Try the below code in script console to see the JIRA Base URL value. But you should have Admin privileges.
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.config.properties.APKeyslog.warn(ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL))
jira.baseurl does not returns the whole URL including the query string (parameters). Any ideas how to achive this?
An alternative is:
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.util.BaseUrlComponentAccessor.getComponent(BaseUrl).baseUri.toString()
It looks like you're new here. Sign in or register to get started.