Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA EMAIL This Issue Question

Kristen Viscardi
Contributor
April 11, 2016

Hello,

I have been creating templates using the JETI plugin, however whenever I input the status field it only displays the status the issue is currently in. Can someone please tell me how to display the status the issue transitioned from with a red background and a strike through and the current status the issue transitioned to in green?

 

Thanks!

1 answer

0 votes
Tibor Hegyi _META-INF_
Atlassian Partner
April 12, 2016

Hi,

This kind of diff view of changed attributes could be rendered as below (I have extracted this from the JIRA email template)

Tibor

#if ($changelog)
<table class="keyvalue-table">
 <tr>
 <th>#text("template.change.by"):</th>
 <td>
 #if ($changelogauthor)
 #authorlinkkey($changelogauthor.key $linkstyle)
 #elseif ($changelogmetadata.actor)
 #emailHistoryMetadataParticipant($changelogmetadata.actor, true)
 #else
 #text("common.words.anonymous")
 #end
 </td>
 </tr>
 #foreach ($changeitem in $changelog.getRelated("ChildChangeItem"))
   #if ($changeitem.getString("field").equals("description"))
   #set ($changelogItemIssueDescription = $changeitem)
   #end
   #if($!changeitem.getString("field").equals("Status"))
   <tr>
     <th>$textutils.htmlEncode($velocityhelper.getFieldName($changeitem, $i18n)):</th>
   <td>
     #set ($oldstringKey = "oldstring") #set ($newstringKey = "newstring")
     #set ($oldText = "") 
     #set ($newText = "")
     #set ($oldText = $velocityhelper.getPrettyFieldString($changeitem.getString("field"), $changeitem.getString($oldstringKey), $i18n, ""))
     #set ($newText = $velocityhelper.getPrettyFieldString($changeitem.getString("field"), $changeitem.getString($newstringKey), $i18n, ""))
     $!diffutils.diff($oldText, "background-color:${auiErrorBackgroundColour};text-decoration:line-through;", $newText, "background-color:${auiSuccessBackgroundColour};")
   </td>
 </tr>
 #end
 #end
</table>
#end
Kristen Viscardi
Contributor
April 12, 2016

Thank you, I will add this to my template and get back to you if I have any problems.

Kristen Viscardi
Contributor
April 20, 2016

I tried copy and pasting this code into my template and it did not work. Any suggestions?

Suggest an answer

Log in or Sign up to answer