Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with a query to identify when two date fields differ from one another

Steve Aretz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 1, 2020

I am attempting to write a query that results with issues where two date fields differ from each other (a little variance is fine).  I'm not sure how to do it.

Rules:

  1. Due Date will be used by reporters of tickets for when they want work to be completed
  2. End date will be used by resource managers for planning work duration from Start date
  3. Sprints are used; there is a unique Sprint for each scrum team; no Sprint is longer than 14 days
  4. Start date will be used by resource managers scheduling when work should start

Problem:

  • The only automation we have is Start date is populated by Create Date which regularly varies from when the actual work start date is/needs to be

Question:

  • I am trying to write a query that tells me both
  • A. When an End date differs from Due Date by more than a few days (5d)
  • B. When a Start date is much earlier that the start of the current Sprint, ie. >= 14d

This is what I've tried so far: (Sprint in openSprints() AND "Start date" >= -14d) OR (duedate <= 14d AND duedate >= -7d AND "End date" <= 14d AND "End date" >= -7d)

The above query has not returned expected results.

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
July 1, 2020

@Steve Aretz when I have to prepare complicated query, I always split it into smaller parts. But my first thought is that "Start date" >= -14d does not contain information about start of the sprint. You mentioned "much earlier". Should not it be something like "Start date" <= -30d

Suggest an answer

Log in or Sign up to answer