Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JQL to find status at a point in a timeline

Imagine I have two tickets, 123 and 456 and I am working in sprint 1.  At the end of sprint 1, 123 gets a status of done but 456 failed testing and must carry over into sprint 2.  If I do a query at this time for anything in sprint 1 that was done, I'd only get 123.  Now, sprint 2 is over and 456 is done...remember it was active for 2 sprints.  If I query now for anything in sprint 1 with a status of done, I get both 123 AND 456 because the history of how long a ticket has been active is, technically it's tru...456 EXISTED in sprint 1, but achieved a Done status in sprint 2.  So what I really want to query for is any ticket that achieved it's status, whatever status I might want IN a given sprint...or something similar.  I do this for reporting to my bosses on what has been completed every sprint and if you go backward in time, reporting starts to get skewed.

I know I'm doing something "wrong"...I just don't know if it is a bad process, data points not being used that might help out with this...but we have tickets that, unfortunately, can end up crossing mutliple sprints and its creating havoc with historical reporting.

Can any one offer up some advice?

2 answers

2 votes
Thomas Schlegel Community Leader Jun 06, 2017

Hi Mike,

you need to know the start and end date of your sprint, then you can use the following jql:

sprint = <sprintname> and status changed to "<your status>" during (<start date of sprint>, <end date of spring>) 

Enter sprint dates in format "yyyy/mm/dd".



Perfect...did not know about during nor status changed....should probably read a book.  Thank you.

0 votes
Tarun Sapra Community Leader Jun 06, 2017

I have faced a similar issue, I wanted to know the "Sprint" of an issue in which it was "done" . So I use the "scripted field" funtionality of the "script runner" plugin and the following script would give you the sprint in whcih the issues was actually closed

ArrayList sprintList = (ArrayList)getCustomFieldValue("Sprint")
int numSprints = (sprintList != null) ? sprintList.size() : 0;
return (numSprints > 0) ? sprintList.get(numSprints - 1).getName() : ""

This looks like an amazing answer but more advanced than I can deal with right now...just getting to know JQL and need simpler solution so I'm not as easily confounded...but thank you for this a developer I find it very appealing and interesting...just not quite enough time on the learning curve right now.

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you