Concept Relates To
Application Type |
Jira (Jira Work Management and Jira Software), Jira Service Management, Jira Core |
Deployment Type |
Jira Cloud, Jira Data Center |
What is shown?
A JQL query using the “CHANGED TO” and “WAS” search operators.
Visit: Jira > Filters > Search work items (Cloud)
Visit: Jira > Issues > Search for issues (Data Center)
What can we learn?
One day I needed to find all items that were once in a particular workflow status. Luckily, JQL supports historical searches of item status. There are two useful operators: “CHANGED TO” and “WAS”. But which should you use? While “CHANGED TO” and “WAS” are similar, they work differently and often return different results.
Definitions
CHANGED TO -> checks to see if a value was altered at any time
WAS -> checks if a specific value was ever present
If these definitions seem confusingly similar, you’re not alone! Sometimes in Jira, reading the documentation and searching discussion threads doesn’t answer your question. The best way to understand a confusing concept is to deconstruct it and try it out yourself (preferably in a test environment.) Here’s how I approached my attempt to better understand the differences between these operators.
Scenario
Find all items in the Jira development (DEV) project that were once in a specific status. The project has a simple workflow like: To Do → In Progress → Done.
First, I ran each query independently to compare the results.
The query project = DEV and status CHANGED TO "To Do" returned 10 results.
The query project = DEV and status WAS "To Do" returned 50 results.
Next, I noticed that the larger WAS query contained all the items returned by the smaller CHANGED TO query.
Then, I created a new item in the DEV project and observed how query results were impacted.
The query project = DEV and status CHANGED TO "To Do" does not return the new item. I assume this is because the initial status was set, not changed.
If I change the new item's status to “In Progress”, and then put in back in "To Do" status, then the CHANGED TO query will return the item.
The query project = DEV and status WAS "To Do" does return the new item.
As such, the WAS clause is more inclusive. That's the one you'll probably want to use for finding items that were once in a specific status.
I hope this helps you understand the differences when searching for historical data!
Resources
Rachel Wright
Author, Jira Strategy Admin Workbook
Industry Templates, LLC
Traveling the USA in an RV
47 accepted answers
0 comments