Scriptrunner query wrong

Yury Ked
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!
February 24, 2025

Hi everybody!

Could someone explain what is the wrong with that query?

Thanks a lot in advance!

photo_5323480739712461025_w.jpg


issueFunction in dateCompare("", "resolutionDate > dueDate")

3 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Seifallah Bellassoued
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 24, 2025

Dear @Yury Ked

Welcome to the community!

You have 2 issues in your query:

  • Sensitivity: It looks scriptrunner search is case sensitive
  • Datecompare require a subquery for the first parameter

To solve that, I guess the following example:

issueFunction in dateCompare("project = TP", "resolutiondate > duedate")

Best Regards,

 

Yury Ked
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!
February 24, 2025

Hi dear @Seifallah Bellassoued Thanks a lot! Now it works! 

How can I implement it for all projects instead particular one in account?

Instead 

project = TP

 

smth like 

project = *

 

Seifallah Bellassoued
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 24, 2025

project = TP is just an example of a subquery. If you want a query giving all tickets in your jira I guess the following:

 

issueFunction in dateCompare("created > 2000-01-01", "resolutiondate > duedate")

 

If my answer resolve your issue, kindly accept it!

 

 Best Regards,

Like Yury Ked likes this
0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 24, 2025

Hi Yury,

The first part of the function where you have "" is an empty subquery and this is not valid in ScriptRunner for Jira Cloud.

The function expects a value to be entered in the subquery to restrict how man issues are returned.

If you enter a subquery, such as to search for specific projects, then the query will be valid.

One tip to make sure the query is valid is to click the + button at the end of the search bar and use the query builder, which will ensure you fill in the valid fields.

I have attached a screenshot of the query builder for the date compare function, which shows that a value must be entered for the subquery.

Screenshot 2025-02-24 at 09.19.01.png

I hope this helps.

Regards,

Kristian

Yury Ked
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!
February 24, 2025

Hi Kristian!
Could you please provide right subquery for that command?

issueFunction in dateCompare("", "resolutionDate > dueDate")
0 votes
Duc Thang TRAN
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 24, 2025

Hello @Yury Ked 

It works fine in my instance data center with your query.

Can you try with  "resolved" instead of resolutionDate 

 

issueFunction in dateCompare("", "resolved > dueDate")
Yury Ked
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!
February 24, 2025

Hi dear friend, the same error

photo_5323480739712461150_w.jpg

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events