Comparing Due Date with Resolved date using JQL Function plugin returns empty result?

arunk February 12, 2018

I have created a JQL Function plugin like issue in dateComparison("RESOLVEDDATE",">","DUEDATE"), but this query is taking more time to get executed, it still takes time and return No issue found.

 

But When i pass the Project key, the results are fetched as expected -> dateComparison("JIRA","RESOLVEDDATE",">","DUEDATE")

 

I came to know that, the getValues() method will get executed 3 times when the JQL is called, I guess this is the reason why it is taking more time and returns no issues.

 

Is there any way to overcome this?can someone help me fix this one?

I wanted to fetch all the issues with this query itself -. dateComparison("RESOLVEDDATE",">","DUEDATE")

2 answers

1 vote
sheriff December 3, 2021

Try using issueFunction in expression()

i.e.

issueFunction in expression("", "created.clearTime()==resolutionDate.clearTime()") ORDER BY created DESC, updated DESC

where:

issueFunction in expression("", "created.clearTime()==resolutionDate.clearTime()") - the condition, that converts Date-Time format of "created" and "resolutionDate" to only Date-format and compares the received dates with each other. You can change == to < or >

Note, that you need using plugin (I'm using ScriptRunner)

0 votes
Maarten Cautreels
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.
February 12, 2018

Hi Arunk,

I don't know too much about developing that kind of plugins for JIRA but I do know that ScriptRunner has exactly that feature built-in and much much more: https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html?utm_source=product-help#_datecompare

Hope this helps.

Best,

Maarten

arunk February 12, 2018

Just needed only the dateCompare function, so we doesn't want to end up buying the paid plugin for this single requirement. Will appreciate if someone can provide the reason for the above mentioned results i am getting while running the JQL Function.

Suggest an answer

Log in or Sign up to answer