Forums

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

How to query when a particular label was added in a jira task?

caliber X December 17, 2020

Here's my query:

(project = "xxxx") AND issuetype = task AND labels in (Approved) AND updated >= startOfWeek(-1w) AND updated < startOfWeek()

Goal: Get all the tasks that has the label "Approved" added last week. 

Updated won't give me the accurate task counts.

Thanks in advance.

 

 

 

3 answers

2 accepted

3 votes
Answer accepted
Geoff Mether _Togetha Group_
Community Champion
December 17, 2020

Hi @caliber X 

Your JQL will return all tasks that have a label with Approved that were updated last week.  NOT where the Approved label was added during the period - essentially you are geting more results than you should.

History searches do not support the 'labels' field (to my knowledge).

You could investigate capturing via a custom field and then searching on that.

Good luck!

G

Radek Dostál
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.
December 17, 2020

Ah that's a good idea too, setting up an Automation rule to update some custom Date field whenever the 'Approved' label is added (to the currentDate).

Then you can filter around this similarly to 'customfield > startOfWeek(-1) and customfield < startOfWeek()', or some other in between comparator.

Should also make sure to clear the field if the label is removed to avoid false matches in the future.

caliber X December 17, 2020

Thanks, will give it a go..

0 votes
Answer accepted
Radek Dostál
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.
December 17, 2020

You cannot currently do this with a JQL search, because the Labels field does not support history searches (feature request: https://jira.atlassian.com/browse/JRACLOUD-36694).

 

Therefore the only way to find when a labels field has been changed or had a particular value added would be through issue history, and this is what certain JQL functions can do. (The out of box ones already utilize this, and some plugin-provided JQL functions do as well.)

This to me sounds like a plugin required, but I don't unfortunately know one from the top of my head that would implement this for Labels.

0 votes
Paron Forge August 5, 2024

Hi @caliber X

At Paron Forge, we developed a gadget that helps to manage label history - Label Ledger. Just pick a label and project/filter and in the table view, you will see 3 events when the label was:

  • added during issue creation
  • added to an existing issue
  • removed from issue

Link to the marketplace

Link to our docs

Suggest an answer

Log in or Sign up to answer