I need help building a Jira filter that will always return exactly one issue - the most recently created one in my project. Right now I’m using this query but it has problems:
project = "my_project" AND assignee = my_user_id AND created >= -24h ORDER BY created DESC
The issue is that this filter looks for tickets created in the last day. When no tickets were made yesterday, I get zero results. But I really need it to always give me the single most recent ticket no matter when it was created.
I’m working with Jira Xray for test automation reporting. Xray generates test execution tickets and I want to build a dashboard widget that shows results from the latest test run. The dashboard needs a filter that points to one specific test execution ticket - always the newest one. Anyone know how to modify my query to make this work properly?
It’s actually pretty simple - just drop the time constraint from your query:
project = "my_project" AND assignee = my_user_id ORDER BY created DESC
Then set your dashboard widget to show only the first result. Most Jira gadgets have a “Maximum results” setting where you can put 1. This fixes the gap problem you’re having with that 24-hour filter.
I’ve done this for automation reports for about two years now. The trick is filtering at the widget level, not in JQL. Your query’s fine - you’re just trying to solve the display problem in the wrong place.
yup, just get rid of that time limit! use project = "my_project" AND assignee = my_user_id ORDER BY created DESC and make sure your dashboard only shows one result. i’ve been doin this for xray as well - super helpful, no more empty results!
The issue arises from the time constraint in your query. To ensure you always retrieve the most recent issue, simply remove the created >= -24h filter. Your revised query should be: project = "my_project" AND assignee = my_user_id ORDER BY created DESC. This allows all relevant issues to be considered, and you can configure your dashboard widget to display only the first result, ensuring it always shows the latest ticket without any gaps.