We're looking for a way to find issues that have had a specific label added before a specific date.
I've used JQL to find changes in fields before, using queries like
status WAS "Resolved" BY jsmith BEFORE "2019/02/02"
But when I try to use any of the "history" functions (including WAS), I get an error saying that "History searches do not support the 'labels' field."
How can we do a search that will give us what we need? We do have ScriptRunner, which includes the Enhanced Search. We are on Cloud.
Hi Esther,
The labels field does not currently hold an updated date or time in a manner that is accesible with JQL as history searches do not support the 'labels' field.
Please check the description of this ticket. Atlassian rejected this due to the limited demand
https://jira.atlassian.com/browse/JRASERVER-36694
Meanwhile, you can try, if this solves your problem up to a certain extent.
Sample JQL
project = "Project Name"AND labels in ("Label Name") AND updated > -1d
Thanks,
Gaurav
Thank you, but I know that query will not get us what we need, because updated will get you any ticket where any of many fields were updated. We need to be able to specify specifically when the labels field was updated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes totally agree with you! but history searches do not support the 'labels' field & Atlassian is not going to work on this in near future.
https://jira.atlassian.com/browse/JRASERVER-36694
Thanks,
Gaurav Pratap [GP]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As an alternative solution, you can try Issue History.
With this app, you could select issues by Label and monitor the history of all changes that were made in issues by dates you need.
Hope it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is an old thread, but I have solved this problem with a script using the Jira API, filtering through the ticket changelog.
def jiraDateToDaysDelta(date: str) -> int:
'''Return the delta in days between now and the date provided'''
date = date.rsplit('-', 1)[0] # Remove timezone
return (datetime.now() - datetime.fromisoformat(date)).days
def ticketHasLabelInTimeframe(ticket: JiraTicket, label: str, LOOKBACK_TIME: int) -> bool:
'''Determine if a label was added to a ticket within the lookback time'''
for update in ticket.changelog.histories:
for field in update.items:
if field.field != 'labels':
continue
if label not in field.toString.split() or label in field.fromString.split():
continue # Skip if label is not present in "TO" or present in "FROM"
if jiraDateToDaysDelta(update.created) <= LOOKBACK_TIME:
return True
else:
# If the ticket is new, or the label was added at ticket creation, this clause is hit
if label in ticket.fields.labels and jiraDateToDaysDelta(ticket.fields.created) <= LOOKBACK_TIME:
return True
return False
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.