I want to include the URL that would address to an issue, on a email template. Does anybody know which property to use? Or way to do it?
I thought this would be a simple and basic task, but I've even found any way to do it.
I'm using Script Runner as a way to test a solution before implementing the final template.
TIA,
Charly
JIRA's own HTML templates contain URL to the issue itself. You can see the templates on atlassian-jira\WEB-INF\classes\templates\email\html
If you want to test it with ScritRunner you can read the base URL and suffix it with /browse/<issue ID>
I'm not sure how you are testing with script runner, but the "send custom email" post-function uses GString templates, whereas jira uses velocity. You can't mix and match. In script runner you can use ${baseUrl}. Unfort the capitalisation differs from the velocity version.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Kerem.
I've tried with:
<a href="${baseurl}/browse/${issue.getKey()}">#text("template.view.online")</a>
But I got an error resolving ${baseurl} and ${issue.getKey()}. I fixed it replacing temporally ${baseurl} with a hardcoded url (while I see how to fix it) and ${issue.getKey()} with ${issue.key}.
This situation made me think I'm misunderstanding something about that model of objects to use.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie, I've tried with the post-function as you told me, it works me with:
<a href="$baseUrl/browse/${issue.key}">$issue</a>
I couldn't find the right resource to know the correct syntax / property names.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<a href
=
"$baseUrl/browse/${issue.key}"
>$issue<
/
a> only gives us a hyperlink in our custom emails to $baseUrl/browse. It doesn't append the issue key to the hyperlink
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try using the "out << " syntax as shown in https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Sendacustomemail
The workflow engine might be mangling it.
Does the $issue bit show the key? If it does just use that in both places.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<a href
=
"$baseUrl/browse/<% out << issue.key %>"
>$issue<
/
a>
This corrected the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This should work:
<a href="$baseUrl/browse/$issue">$issue</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On the Send an Email Post function, I've selected HTML and used
<a href="baseUrl/browse/%{nnnnn}">%{nnnnn}</a>
%{nnnnn} is the field code injector. I've put the field code for Issue key - %{00015} there and the URL works fine for me in the Email.
<a href="baseUrl/browse/%{00015}">%{00015}</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.