Reputation: 456
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.
Upvotes: 1
Views: 2488
Reputation: 6881
Run the query and sort by the date field. First row is the max or min
Upvotes: 0
Reputation: 1061
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)
Upvotes: 2