There was a question about sending issue details and all the comments added on the issue as an email using script post-function.
Solution
1. Try this for priority.
- ${issue.priority.name}
2. For last comment try this.
- ${com.atlassian.jira.component.ComponentAccessor.getCommentManager().getLastComment(issue).body}
For all comments try this.
- <ul>
- ${com.atlassian.jira.component.ComponentAccessor.getCommentManager().getComments(issue).collect{'<li>'+it.body+'</li>'}.join('<br>')}
- </ul>
If your code is more than one line then try something like this.
- <%
- def lastComment = com.atlassian.jira.component.ComponentAccessor.getCommentManager().getLastComment(issue)
- if (lastComment != null) {
- out << "Last comment: " << lastComment.body
- }
- %>
To generate the baseurl and complete issue url use this code.
- <%
- def baseUrl = com.atlassian.jira.component.ComponentAccessor.getApplicationProperties().getString("jira.baseurl")
- def issueUrl = baseUrl+"/browse/"+issue.key
- %>
- <p>Please approved the issue</p>
- <p>Issue full url: ${issueUrl}</p>
- <p>Issue link: <a href = ${issueUrl}>${issue.key}</a></p>
I hope it helps. In case you want to learn ScriptRunner for Jira, I have a proper course with plenty of guided videos.