Forums

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

Jira Gadget for Open Issues Age

Srilata Meka
Contributor
August 15, 2020

Hi,

Can anyone please suggest which two dimensional Jira Gadget to use for something like..reporting Issue Id on X Axis & Issue Age on Y Axis.

Please note ‘Average Age Report’ does not suffice our need.

Thanks in advance!

1 answer

1 accepted

3 votes
Answer accepted
Ste Wright
Community Champion
August 15, 2020

Hi @Srilata Meka 

You need a field to display the issue age first, to then visualise this data on a dashboard gadget.

I've found a method to do this using Automation for Jira.

--------------

To do this, as a Jira Admin:

  1. Go to Jira Settings > Issues > Custom Fields
  2. Press the blue "Create Custom Field" button in the top-right
  3. Add a Number Field - and call it "Issue Age". You can add it to a screen - I chose not to so it wasn't visible / editable by users.
  4. Next, go to Automation. At a project-level, go to Project Settings > Automation - or for global rules, go to Jira Settings > System > Automation Rules
  5. Press the blue "Create Rule" button in the top-right
  6. For the Trigger, use "Scheduled" - schedule to run the rule once per day.
  7. On the same Trigger, check the "Run a JQL Search" box to TRUE, then enter appropriate JQL - eg. for a whole project, this might be project = ABC, or for only open issues, this might be project = ABC and resolution IS EMPTY. This is the set of issues the rule will run against.
  8. Next, add an Action - "Edit Issues" - choose to set your new custom field "Issue Age" - for the value enter: {{now.diff(issue.created).abs.days}}
  9. Give the rule a name and publish it
  10. Press the blue "Run Rule" button to populate the data immediately

^ This rule calculates the difference between the created date and today, providing a numeric value in the field.

You can then use this field in a dashboard gadget - for example, a Filter Results gadget, using a filter which looks for open issues. Select "Issue Age" as one of the columns.

--------------

A few additional notes:

  • Project Level: I would create this rule at a project-level. This is because you have virtually unlimited executions at this level. At global-level, you only receive 500 executions per product, per month - so you might end up utilising these quickly with this rule.
  • Text: If you want to display "XX days" rather than just a numeric value, create a "Text Field (Single Line)" on Step 3 instead - then in Step 8, enter the value as {{now.diff(issue.created).abs.days}} days
  • JQL Refinement / Lead Time: Consider refining the JQL in Step 7 if you have a large number of issues in your project - for example by issue type or, as seen above, including AND resolution IS EMPTY so the rule only runs on open issues. An added benefit to filtering for open issues is the field would also display lead time, as the count would stop at issue closure!
  • More Info: For more information on calculating values based on dates, see this page

--------------

Let us know if this works for you!

Ste

Jack Brickey
Community Champion
August 16, 2020

Stephen,

nice solution. One question, is this missing the part of only updating the Issue Age for open issues? Would you not want to add “AND status category != Done” in the JQL?

Like Ste Wright likes this
Srilata Meka
Contributor
August 16, 2020

Hi @Ste Wright 

Thank you for detailed response - I appreciate the time you took to explain the steps needed to be taken. I will give it a try and keep you posted.

Thank you,

SM

Like Ste Wright likes this
Ste Wright
Community Champion
August 16, 2020

Awesome @Srilata Meka - let us know how it goes!

@Jack Brickey - I actually did build it in a similar manner, I used AND resolution IS EMPTY

I left it off the original answer to give the choice of utilising the JQL best suited - but I think you're right, it makes sense to mention it (I've refined the wording). It would be beneficial if you have a large number of issues.

With this included you could also use "Issue Age" for both days since created and the lead time, as the count will stop after resolution has been set :)

Ste

Like Srilata Meka likes this
Srilata Meka
Contributor
August 17, 2020

Thank you @Ste Wright , the solution worked. I really appreciate how quickly you responded with a detailed solution.

Like Ste Wright likes this
Srilata Meka
Contributor
October 12, 2020

Hi @Ste Wright , The solution suggested by you had been working great for Project A. Now I am applying this 'Automation Rule' to all the existing projects in our Jira instance.

I updated the Scope of the Automation Rule to Global & ran the Rule. But Rule ran only on Project A.

I tried editing one of the 'Issue' from Project B and ran the rule, 'Issue age' was displayed only for this defect from Project B.

I tried updating the Scope to 'Multiple projects', updated even JQL query and ran the Rule. but still no luck.

Can you please let me know, what am I missing?

Any help would be greatly appreciated. Thank you ! 

Issue Rule.JPG

Srilata Meka
Contributor
October 13, 2020

Hi @Ste Wright , Thank you,  I am all set! 

Your initial response had the answer to my yesterday's question. I setup the automation rule at project level & am seeing the expected results.

Like Ste Wright likes this
Leigh Elliott
Contributor
June 27, 2022

This worked really well, however when I ran the automation it appears that when the "Issue Age" custom field was updated all subcribers and watchers of issues that met the JQL query received an email letting them know that the automation ran and the calculated value of the "Issue Age" field.  Is there a way to prevent updates to the new "Issue Age" field from triggering email updates to end users?

Ste Wright
Community Champion
September 2, 2022

Hi @Leigh Elliott 

When creating the Action, you should be able to...

  • Open the More Options section
  • Ensure the Send Notifications? checkbox is set to OFF

^ I'd test this though, to see if it applies to subscribers/watchers. Let us know how you get on :)

Ste

Like Leigh Elliott likes this
Leigh Elliott
Contributor
September 4, 2022

Thanks Stephen, yes found this setting after creating the automation.  Forgot to update this post. It’s does work.

Like Ste Wright likes this
robert cortez
Contributor
March 7, 2023

I have set this up, and it doesnt seem to be accurate. I have tickets created last month on feb 6th (almost 29 days ago) and the issue age in my dashboard is displaying the ticket as '4 days old'. 

gumapathy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 13, 2024

custom field created is not showing in the gadgets for selection, also it will be great if you could recommend which gadget will be helpfull to show the issues of age <5, 5<15, 15<30 ,30 <45 and <45 seperately  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events