Show and store reporter metric on JIRA Issues

Carlos Gavidia May 24, 2017

I'm trying to develop a plugin for showing and reporting reporter metrics on JIRA issues. For example, with the metric called "number of reported issues", I'd like to do the following:

- Show the "number of reported issues" for a reporter on every issue.

- Update the "number of reported issues" value when a user reports an issue.

Like that, I have several other metrics. I was reading and doing some tutorials regarding Custom Fields, but they seem to be  at the level of issue. Is there something similar for users?

 

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2017

The data you are trying to display is global, but you want to see it within the context of an issue, which is why you've ended up looking at fields.

  I'd stay away from issue fields because although you could write a field that would hold the number, it's not an issue field.

I would write a new panel for the issue view screen myself, one that can display anything you want.  Within that, you should be able to fetch the user you want from the reporter field on the issue, and then run some JQL like "reporter = x" and fetch just the size of the results for display.

There is a caveat on that trick - it requires the current user to be able to see all the reported issues.  If you don't have "global read", it's only going to report the number that the user can see.  If you want it to count everything, you'll have to run the code as a priviliged user who can see everything, or think about creating storage for the data that can be updated on every issue create/update.  (An issue for each user to hold the field maybe, or an active object for each user)

Suggest an answer

Log in or Sign up to answer