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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,323 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot