How to use the value from date field in filter query

Mark McDonnell November 22, 2018

I would like to use a date field, either the system "duedate" or my own custom date field, as a value for comparison in a filter query, for example to see issues where a particular status transition was made before a specific date. I've tried lots of combinations such as;

project = XY AND status changed from "Start" to "In progress" before duedate

But the query will only accept a specific date or a relative date (e.g. "-5d") after the term "before". Is there some way to use the value from a date field like this?

 

Thanks

3 answers

0 votes
Shawn Masters
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 23, 2018

Found an Addon that might help you with this.... Abacus for Jira Cloud. It allows you to create Formula based on Jira fields. 

Mark McDonnell November 26, 2018

Thanks Shawn, that only seems to be available for JIRA cloud though and I'm on server unfortunately.

0 votes
Robert de Groot November 23, 2018

Hi

Unfortunately there is no way to compare two fields in Jira.

The only way I can think of to accomplish this would be to build your own plugin to create a custom jql function that you can pass a custom_field_id to and returns a date.

example of resulting JQL:

status changed from "Start" to "In progress" before getCustomFieldValue(customfield_123456)
Mark McDonnell November 26, 2018

Ok thanks. Shame that you can compare either field to an absolute date but not to each other.

0 votes
Shawn Masters
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2018

https://confluence.atlassian.com/jirasoftwarecloud/advanced-searching-operators-reference-764478341.html

  • Find all issues with 4 or more votes:

    votes >= 4
  • Find all issues due on or after 31/12/2008:

    duedate >= "2008/12/31"
  • Find all issues created in the last five days:

    created >= "-5d"
Mark McDonnell November 22, 2018

Thanks Shawn.

I know I can use absolute dates or relative dates in my query as a comparison to a date field as per your examples. What I'm looking to do is to use the value from a date field as a comparison to another non-absolute factor, such as another date field.

For example;

Comparison between due date and another user defined date field:

duedate <= MyDateField

Comparison between a user defined date field and the date a status was transitioned:

status changed from "Start" to "In progress" before duedate
status changed from "Start" to "In progress" < duedate
Shawn Masters
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2018

I haven't run across a way to do quite that, especially that first example. 

#2 could look something like ...

 status was in "Start" And status in "In Progress" And duedate <= "Insert Date" 

Suggest an answer

Log in or Sign up to answer