Question

Using Jira Issue Search, I have two custom date fields in my project. I want a filter that returns the issue with the earliest date from field 1. I want another filter to return issue with latest date from field 2.

Has anybody done a query similar before. I dont know the correct syntax and checking on Atlassian documents doesnt mention anything about max or min.

Was it helpful?

Solution

You can create your own JQL functions using a free plugin such as Script Runner.

To get the data from Jira database, find the id of your custom field using

select * from customfield

Then use something like this

select 
    pkey
    , summary
    , datevalue

from 
    customfieldvalue c
    , jiraissue i

where 
    i.id=c.issue
    and c.customfield = 10071 
    and c.datevalue in (select min(datevalue) from customfieldvalue where customfield = 10071)

OTHER TIPS

Run the query and sort by the date field. First row is the max or min

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top