In this article, I will introduce you to the date or history search in Jira. This will allow you to create monthly reports for example thanks to the dashboards. If you have read all the previous articles, you are now an expert in searching in Jira.
Nevertheless, everything we have seen brings back data as it is at the moment. For example, we can find all the data that are in a particular state, all the data that are assigned to a user or all the data that are currently resolved.
But in some cases, we want to search for requests on a historical criterion, in relation to a situation at a given time or in relation to an event that took place during a period.
For example, one may want to search for all requests that have passed in a particular status on a particular date.
You may need to find all the requests that were assigned to a particular user on a certain date, for example, at the end of the previous month.
It is particularly interesting for the production of the report at the beginning of the month where the activity of the previous month is analyzed.
JQL operators to use in a Jira historical search
To do these searches, there are specific operators:
- " was ": if I want to find the requests for which the field had a certain value.
- " was in ": if I want to find the requests for which the field was in a value list.
- " was not " and " was not in " are the associated searches.
- I'll use the " changed " option if I want to retrieve requests for which the value of a field has changed.
However, these operators are not available for all fields. For example, when the administrator creates custom fields, it is not possible to use them with these operators. The fields that do support them are: maintainer, fix version, priority, requester, resolution and status.
Nevertheless, a lot of information can already be found.
Jira search by specific dates
For example, let's look for the list of requests whose manager was Alana at the end of the previous month. The query to use is the following:
assigned was agrant on endOfMonth(-1)
In the same way, we may want to find at the beginning of the month the list of requests that were not resolved at the end of the previous month. To do this, we can perform the following query:
resolution was empty on endOfMonth(-1)
Now, how to find all the applications that have changed status between two dates?
For example, I want to find requests that changed status the week before last. The field to query is " status " and what we want to look at are the requests that have changed. So the query is :
status changed during (startOfWeek(-2), startOfWeek(-1))
We could also have put " endOfWeek(-2)".
So we look for the list of requests whose status has changed over a period of time. I specify the value of the first date and the value of the second date. This gives: beginning of week N-2 and beginning of week N-1.
Search for requests that were in a particular Jira state and by a specific date
We can go even further. For example, I can search for the list of requests that went from "Completed" to "To Do" in the last week but one, so the requests that were reopened.
Taking the previous request I will enrich it:
status changed from Done to " To Do " during (startOfWeek(-2), startOfWeek(-1))
And we can go even further by searching by person who did the action. And in this case, I can add :
status changed from Done to " To Do " by membersOf(" jira-administrators ") during (startOfWeek(-2), startOfWeek(-1))
So I'll find the entire list of my requests that went from "Completed" to "To Do" status in the week before last, when this action was taken by a member of the administration team.
The search by dates or history in Jira adds a lot of power to the search. It can be used to carry out a one-off search to identify a failure or a process error after the fact, or to produce end-of-month reports to be sent to management by always reusing the same filters. At this stage, you have all the keys to become a master of research in Jira. I wish you a lot of fun with JQL queries.
If you find any original queries that you're particularly proud of, feel free to share them in comments. In the next and final article in our series on Jira search, we'll look at how to include one filter within another.