Hey everyone, I’m stuck trying to set up a Jira filter that’ll show me the single most recent ticket created. Right now, my filter looks like this:
project = "ProjectX" AND reporter = UserY AND created >= -1d ORDER BY created DESC
The problem is, this only shows tickets from the last day. If nothing was made yesterday, I get zilch. What I really need is a filter that always gives me that one latest ticket, no matter when it was made.
I’m trying to use this for a test result summary chart on our Jira dashboard. We use Jira-Xray for reporting test runs, which makes test execution tickets. There are templates for summary charts, but I need to feed it a filter that picks up just the newest test execution ID.
Any ideas on how to tweak my filter to always grab that most recent ticket? Thanks in advance for any help!
hey markseeker91, i think i got a solution for ya. try this filter:
project = “ProjectX” AND reporter = UserY ORDER BY created DESC
this should always grab the newest ticket, no matter when it was made. just remove the time constraint and keep the descending order. hope this helps with ur test summary chart!
I’ve dealt with similar Jira filter issues before, and here’s what worked for me:
project = “ProjectX” AND reporter = UserY AND issuetype = “Test Execution” ORDER BY created DESC
This query should always return the most recent Test Execution ticket, regardless of when it was created. The key is removing the time constraint and adding the specific issue type for Xray test executions.
For your dashboard, you might want to set the ‘Max Results’ to 1 in the gadget settings. This ensures you’re only pulling the single most recent ticket.
One thing to watch out for: if you have multiple projects or reporters creating test executions, you might need to adjust the filter accordingly. Also, double-check that ‘Test Execution’ is the correct issue type name in your Jira instance, as it can sometimes be customized.
I’ve encountered a similar challenge in the past. The solution is indeed to remove the time constraint from your JQL query. Here’s an optimized version that should work for your needs:
project = “ProjectX” AND reporter = UserY ORDER BY created DESC
This query will return all matching issues, sorted by creation date in descending order. To limit it to just the most recent ticket, you can add a maxResults parameter when executing the query through the API, or simply look at the first result if you’re using it in a dashboard gadget.
For your specific use case with Jira-Xray test executions, ensure you’re filtering for the correct issue type if necessary. This approach should provide a reliable method for your test result summary chart to always display the latest execution data.