• Community
  • Products
  • Jira
  • Questions
  • Is there a way to show a notification's precipitant what their role is in the issue they received a notification for?

Is there a way to show a notification's precipitant what their role is in the issue they received a notification for?

Jasen Sparacino February 12, 2014

When I recieve a notification from JIRA the email basically just has the action in it. I would also like the notifiy me of my role in that issue that I was notified about. Am I the assignee, reporter, watcher, or any other role that I may make.

Thanks :)

2 answers

1 accepted

1 vote
Answer accepted
Andy Brook [Plugin People]
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.
February 13, 2014

Yea, its an interesting thing to know, JEMH could actually inject this into the velocity context, without much more than a $notificationSchemeEntity.getType(), its a one liner now I think of it, but of course, you'd need to use JEMH for notifications to do that ;) HEck, Ive just added it, so JEMH will be able to do that in the next 1.5.33 release. Ive just run a test case and get, doc'd on the wiki:

Scheme: id=10204, type=Current_Assignee
0 votes
Andy Brook [Plugin People]
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.
February 13, 2014

Tricky.

A close thing is to get the roels the the current user, which is done through the notification manager. You dont have that in the default context for built in mail handlders.

You can do that with JEMH, it has 'allRoles' as a reference to the role manager (key name was legacy due to a Jira knowledgebase article)

https://docs.atlassian.com/jira/latest/com/atlassian/jira/security/roles/ProjectRoleManager.html

Then you can use the following to get what Roles the current user has through this method.

To figure out which of these was related to the current issueEvent is a bit harder, you'd need to use the NotificationSchemeManager. Then, you can loop through the various Scheme Entities for a match on the users Entities.

Possible, yes, but not not in current JIRA, and JEMH doesn't currently have this, you'd have to roll your own.

Really, do you need to know? The reason I say this is because a user gets notified on the 'first' match in the given event?

Jasen Sparacino February 13, 2014

I am on board with the "do you need to know". I argured it but I am just a lowly IT gnome. We abuse our notification and watchers where I am so I guess I can see why some would want it. We had it working on 4.4, we needed to do some source code modification and someone else did that. I was hoping there was a cleaner way to do so. The other reason I can think is to more efficently filter emails... maybe, I don't know. Thinks for the tips and if I get it working I'll let you know.

Suggest an answer

Log in or Sign up to answer