Help with email template for JIRA release notes

I am new to velocity, and trying to figure out how to create a JIRA release note template that groups tickets by a custom field and displays wiki markup formatting as the description from another custom field. Below is my attempt at solving this request, but it isn't returning anything except for the ticket numbers. Any help is greatly appreciated!

 

#disable_html_escaping()
#set($rendererManager = $componentManager.getRendererManager())
#set($wikiRenderer = $rendererManager.getRendererForType('atlassian-wiki-renderer'))
#set($none = [])
#set($ownerSupport = [])
#set($sales = [])
#set($terminals = [])
#set($accounting = [])
#set($procurement = [])

#macro (createIssueList $issueList $heading)
	#set($customFields = $customFieldManager.getCustomFieldObject($issue.project.getLong("id"), $issue.issueType.getString("id")))
	#set ($ircontext = $issue.getIssueTypeObject())
	
	<h3><strong>$heading</strong></h3>
	<ol>
	
	#foreach($customField in $customFields)
		#if($customField.name.equals("User Friendly Release Note"))
			#set($value = $customField.getValue($issue))
			#foreach($issue in $issueList)
				<li><a href='$!requestContext.baseUrl/browse/$issue.key'>$issue.key</a> - $value - $wikiRenderer.render($value, $ircontext) - $customField.getValue($issue)</li>
			#end
		#end
	#end
	
	</ol>
	<br>
#end

<title>$textUtils.htmlEncode($action.getText('release.notes.text.title', $project, $version))</title>
<title></title>
<body>

<div class="ops-cont">
    <ul class="ops">
        <li>
            <a class="button first last" href="$!requestContext.baseUrl/secure/ConfigureReleaseNote.jspa?projectId=${versionObj.projectObject.id}&version=${versionObj.id}">$action.getText('releasenotes.configure')</a>
        </li>
    </ul>
</div>
#foreach($issueType in $issueTypes)
    #if($issueType.issues.size() > 0)
        #foreach($issue in $issueType.issues)
			#set($groups = $customFieldManager.getCustomFieldObject($issue.project.getLong("id"), $issue.issueType.getString("id")))
			#set($groupFound = 0)
			
			#foreach($customField in $groups)
				#if($customField.name == "Release Note Audience")
					#set($groupName = $customField.getValue($issue))
				#end
			#end
						
			#if ($groupName == "Owner Support")
				$ownerSupport.add($issue)
				#set($groupFound = 1)
			#end
			
			#if ($groupName == "Sales Reps")
				$sales.add($issue)
				#set($groupFound = 1)
			#end 
			
			#if ($groupName == "Terminals")
				$terminals.add($issue)
				#set($groupFound = 1)
			#end
			
			#if ($groupName == "Accounting")
				$accounting.add($issue)
				#set($groupFound = 1)
			#end
			
			#if ($groupName == "Procurement")
				$procurement.add($issue)
				#set($groupFound = 1)
			#end
			
			#if($groupFound == 0)
				$none.add($issue)
			#end
        #end
    #end
#end


<h1><strong>$action.getText('release.notes.heading', $project, $version)</strong></h1>
#if ($ownerSupport.size() > 0)
	#createIssueList($ownerSupport "Owner Support Release Highlights")
#end

#if ($sales.size() > 0)
	#createIssueList($sales "Sales Reps Release Highlights")
#end

#if ($terminals.size() > 0)
	#createIssueList($terminals "Terminal Release Highlights")
#end

#if ($accounting.size() > 0)
	#createIssueList($accounting "Accounting Release Highlights")
#end

#if ($procurement.size() > 0)
	#createIssueList($procurement "Procurement Release Highlights")
#end

#if ($none.size() > 0)
	#createIssueList($none "Misc Release Highlights")
#end
</body>

0 answers

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

555 views 6 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you