It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Add custom thumbnail/icon/text next to name in comment based on user group Edited

I need to achieve that in issue comments, based on user group, for an example if comment user is in group developers show in comment header some text/icon near user display name. In this case text shows [DEV] - which indicates that user is developer. 

As i understand that place which renders the comment header is in file:

$JIRA-HOME/WEB-INF/classes/templates/plugins/jira/macros.vm

near at

$i18n.getText('issue.tabpanels.comment.action.header', $userformat.formatUserkey($authorKey, 'profileLinkActionHeader', "commentauthor_${comment.id}_$!{suffix}"), $createdDate) #if($visibilityLevel) - $visibilityLevel #end #if($updateInfo) - <span class="redText subText" title="$updateInfo">$i18n.getText('common.concepts.edited')</span> #end


I tried to add a simple user lookup in groups using $jiraUserUtils or $groupManager helper class methods and shows some text based on group:

#if($groupManager.getGroupNamesForUser($author).contains("developers"))
     <span>[DEV]</span>
#end

or

#if ($jiraUserUtils.getGroupNamesForUser($author).contains("developers"))
    <span>[DEV]</span>
#end


But it seems that in this template $jiraUserUtils$groupManager helper class not available in the context.

Any ideas how to get work it here?

The main idea is to show that comment owner/updater is internal developer not external requester. 

Something like that:

dev-next-to-name.PNG

ENV: JIRA: 7.x

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

375 views 1 3
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you