How to exclude a custom field from update notifications

Tim Theis May 6, 2014

How can I exclude a custom field content from being included in the update JIRA notification?

This particular field (group sign-off plugin) contains a long script that is applied during a transition into an approval status. It is rendered graphically by the plug-in on the UI, but the JIRA notificaiton sends the raw script (which is just confusing to the end user).

I would assume the principle method of removing a custom field from notifications would be the same regardless of the field type.

Thanks!

6 answers

1 accepted

2 votes
Answer accepted
JK
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 13, 2014

To hide some fields in email-notification I added following if-clause to velocity-template changelog.vm.

#foreach ($changeitem in $changelog.getRelated("ChildChangeItem"))
    #if(!$changeitem.getString("field").equals("FIELDNAMETOHIDE"))
		<tr valign="top">
		SOME CODE
		</tr>
    #end
#end

The file can be found for html-mails in \%JIRA-HOME%\WEB-INF\classes\templates\email\html\includes\fields and for text-mails in \%JIRA-HOME%\WEB-INF\classes\templates\email\text\includes\fields.

Mike Lench
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2014

Jochen, thanks for great reply!

Looks like right answer to my case.

Tim Theis November 7, 2014

Thank you Jochen - much appreciated!

Ramaiah Pendli January 24, 2017

Can any one help us with the code changes.

Kota Sreenivasa Shravana Kumar January 27, 2017

Jochen

What code should be written in place of "SOME CODE" below ? Please advise.

 

#foreach ($changeitem in $changelog.getRelated("ChildChangeItem"))
    #if(!$changeitem.getString("field").equals("FIELDNAMETOHIDE"))
        <tr valign="top">
        SOME CODE
        </tr>
    #end
#end
JK
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2017

Depends on what you want to show in the email notification. If you let the code as it is in JIRA Standard and just insert the if-clause, notifications are sent as normal but not for the change event of the excluded field. 

Kirstin Seidel-Gebert
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 28, 2019

Sad enough, this doesn't seem to work anymore with latest JIRA versions. Instead of no notification I get an empty one - saying that the issue has been changed but not listing the changes.

Cheers,
Kirstin

1 vote
Deleted user June 20, 2017

Is there any other method available to suppress the Jira Notifications for a particular field without really making the changes in core templates ?

0 votes
Patrick Albrecht January 23, 2024

It's a very old topic, but I was just looking for a solution with Jira 9.4 and this one works:

Edit email-batch/html/IssueUpdateBatcher-content.vm

 <table>
#foreach($update in $fieldGroup.updates)
#if($update.fieldName.equals("FIELDNAMETOHIDE"))
<tr class="field-update">
<td valign="top" align="left" class="updates-diff-label">$escape.apply($update.fieldName):</td>
<td valign="top" align="left" class="updates-diff-content">REMOVED</td>
#end
#if(!$update.fieldName.equals("FIELDNAMETOHIDE"))
<tr class="field-update">
<td valign="top" align="left" class="updates-diff-label">$escape.apply($update.fieldName):</td>
<td valign="top" align="left" class="updates-diff-content">$update.diff</td>
#end
</tr>
#end
</table>

Please note that you need to add the display name of the field, not the internal one.

0 votes
Alexander Pöhl November 11, 2014

Does anybody have an idea, how to do this programmatically in scope of a plugin development?

My developed custom field also contain some "cryptic" uninteresting content for the user and I don't want to delegate the problem to an administrator who is running the plugin in his JIRA instanz.

0 votes
eric anier
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 13, 2014

any update on this?

0 votes
Mike Lench
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2014

i'm also interesting in this question.

guys, is there any news to this topic?

Suggest an answer

Log in or Sign up to answer