Forums

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

Jira automation: Add label when issue is older than X amount of monhts

Diana Dvorska March 15, 2024

Hi all,

 

I'd like to be able to see all my backlog issues that are older than 6months (from the date of creation of the ticket) and thought that might be solved with a label being automatically assigned. However I do not see such automation. Has anyone else tried to set up something similar?

 

Thanks!
Diana

4 answers

4 accepted

1 vote
Answer accepted
Ste Wright
Community Champion
March 16, 2024

Hi @Diana Dvorska 

Whilst this is possible, I don't think it's necessarily the best solution - I would either...

  1. Set the Card Colour to red (or similar) - this adds a red stripe to the front of those issues
  2. Use a Quick Filter, so you can limit your Backlog to show only issues created over 6 months ago
  3. Add a flag using Automation (if the above two options aren't ideal). Flags turn the issues yellow, making them easier to see.

---

JQL - Board Options

You'll need JQL for (1) and (2) - I'd recommend something like this:

created < 180d AND (Sprint is EMPTY OR Sprint not in openSprints() AND sprint not in futureSprints())

^ This JQL finds issues that are over 180 days old, and either have not been in a Sprint, or are not in an active/future Sprint - therefore are on the Backlog.

You could further limit results by excluding closed issues - for example:

created < 180d AND (Sprint is EMPTY OR Sprint not in openSprints() AND sprint not in futureSprints()) AND resolution is EMPTY

---

Option 1 - Card Colour

  1. On your Board, select the breadcrumbs (...) in the top-right
  2. From the list, select Configure Board / Board Settings
  3. Next, from the left-hand menu select Card Colours
  4. Choose the method Queries
  5. Choose a colour, and enter the JQL from above

---

Option 2 - Quick Filter

  1. On your Board, select the breadcrumbs (...) in the top-right
  2. From the list, select Configure Board / Board Settings
  3. Next, from the left-hand menu select Quick Filters
  4. Create a new quick filter, give it a name, and enter the JQL from above

---

Option 3 - Automation:

  • Trigger: Scheduled
    • Run rule every = 1 Days
    • Run a JQL search... = TRUE (check box)
    • JQL - created < 180d AND (Sprint is EMPTY OR Sprint not in openSprints() AND sprint not in futureSprints()) AND resolution is EMPTY AND "Flagged" is EMPTY
    • Only include issues that have changed... = FALSE (uncheck box)
  • Action: Edit Issue
    • Field = Flagged
      • Value = Impediment

---

Option 4 - Automation Labels:

If you did want to use your option, you could do this:

  • Trigger: Scheduled
    • Run rule every = 1 Days
    • Run a JQL search... = TRUE (check box)
    • JQL - created < 180d AND (Sprint is EMPTY OR Sprint not in openSprints() AND sprint not in futureSprints()) AND resolution is EMPTY
    • Only include issues that have changed... = FALSE (uncheck box)
  • Condition: Issue Fields Condition
    • Field = Labels
    • Condition = contains none of
    • Value = Label Here
  • Action: Edit Issue
    • Field = Labels
      • Value = Label Here

---

Notes:

  • (3) includes checking Flagged is empty in the JQL, as there's only two options - populated or not
  • (4) uses a Condition to check the Label isn't present already - which is an alternative method than adding to the JQL
  • If using Automation, consider an additional rule to remove the Flag/Label once an issue is added to a Sprint or closed as not needed

---

Let us know which option is right for you!

Ste

Diana Dvorska March 25, 2024

that's awesome! thank you so much Stephen

Like Ste Wright likes this
Diana Dvorska March 26, 2024

I've went for option 4 and for some reason newer tickets created Feb 2024 are being labeled. Trying to troubleshoot why that's the case.

Ste Wright
Community Champion
March 28, 2024

Hi @Diana Dvorska 

What is the JQL you've used for the rule?

Ste

Diana Dvorska March 29, 2024

I've used:

created < 180d AND (Sprint is EMPTY OR Sprint not in openSprints() AND sprint not in futureSprints()) AND resolution is EMPTY

 

And the results are only new/to do items which is right but items from 2020-2022 as well. I wonder whether I need an extra rule because all issues older than 180d have been edited.

0 votes
Answer accepted
Bill Sheboy
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.
March 16, 2024

Hi @Diana Dvorska 

What purpose / value does the label provide?  For example, is it meant to be a visual indicator when the labels field is added to the backlog view?

 

Instead, have you tried using a quick filter with JQL to just view the older issues:

created <= startOfDay(-180)

 

Kind regards,
Bill

0 votes
Answer accepted
Dan Breyen
Community Champion
March 15, 2024

There is a Template Automation called 'Resolve issues due to inactivity' which is very similar to what @Alex Koxaras _Relational_ provided.  You're basically building off of that and by adjusting the criteria, should be able to get exactly what you're looking for.

0 votes
Answer accepted
Alex Koxaras _Relational_
Community Champion
March 15, 2024

Hi @Diana Dvorska 

You could have a rule like the following:

add labels.png

Where on the "Edit Issue" you just add the label.

Let me know if that helps!

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