Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello!
I'm trying to setup "Send a custom email" with Email template shown below. Preview works fine, and shows list of issues. Emails coming. But they are empty.
Did anyone have this problem? Tank you for any help!
ScriptRunner v3.1.4 / Jira v6.4.7
<%
def cfFixVersions = issue.getFixVersions()//array of Strings
def issueVersiiArrayOfStrings = cfFixVersions.collect{'"' + it + '"'}
def issueVersii = issueVersiiArrayOfStrings.toString()
issueVersii = issueVersii.substring(1, issueVersii.length() - 1)
def String jqlQuery = "fixVersion in (" + issueVersii + ")"
def user = com.atlassian.jira.component.ComponentAccessor.getJiraAuthenticationContext().getUser()
def jqlQueryParser = com.atlassian.jira.component.ComponentAccessor.getComponent(com.atlassian.jira.jql.parser.JqlQueryParser)
def searchProvider = com.atlassian.jira.component.ComponentAccessor.getComponent(com.atlassian.jira.issue.search.SearchProvider)
def query = jqlQueryParser.parseQuery(jqlQuery)
def jqlresults = searchProvider.search(query, user, com.atlassian.jira.web.bean.PagerFilter.getUnlimitedFilter())
def issueTypes = [:].withDefault {[]}
def jqlIssues = jqlresults.getIssues()
for (issueItem in jqlIssues) {
def issueTypeObjectName = issueItem.getIssueTypeObject().getName()
issueTypes[issueTypeObjectName].add(issueItem)
}//end for (issueItem in jqlIssues)
def String strResult = ""
for (issueType in issueTypes){
if (issueType.value.size() > 0){
strResult = strResult + issueType.key + '\n'
for (issueItem in issueType.value){
strResult = strResult + issueItem.getKey() + " " + "[" + issueItem.status.name + "]" + " " + issueItem.summary + '\n'
}//end for
}//end if (issueType.value.size() > 0
}//end for (issueType in issueTypes)
out << strResult
%>
Hello,
I think that this may be an old bug effecting the version of SR that you're using.
Check out this community post and this bug report from that explain the issue a bit more.
Let me know if you have any further questions.
Regards,
Jenna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.