Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

issueFunction in dateCompare example

Dear community!

 

Here I am again searching for a help.

I am trying to use issueFunction in dateCompare in my JQL request and I am repeatedly getting errors instead of what I want. 

For example I try to find issues that had not been commented within one week of creation:

project = Operations AND issueFunction in dateCompare("created +1w < firstCommented")

and I get:

Scripted function "dateCompare" compilation failure. Contact administrator and check logs. Message: The comparison must contain exactly one comparison operator which is either >, <, =, <= or >=.

Can someone give me a whole line of successful JQL request so I can repeat it with my own data?

Just cannot get how it works. Please help. Thank you! 
 

1 answer

Hi @Daria Pavlova ,

you forgot something in your syntax.

The JQL query works as follows:

dateCompare(Subquery, date comparison expression)

You added the subquery in front of the issuefunction, and jumped right to the date comparison.

You can do what you want in 2 ways:

  • keep your project conditon in front and use an empty subquery (better)
    project = Operations AND issueFunction in dateCompare("", "created +1w < firstCommented")
  • add your condition as subquery (less performant)
     issueFunction in dateCompare("project = Operations", "created +1w < firstCommented")

Hope this helps!

  • Tessa

I'm having a bit of trouble with the formatting when you try and put things with two words in the subquery

 

issueFunction in dateCompare("Issuetype = Planned Change AND created >= startOfYear()", "Scheduled End < Scheduled Start")

 

Error in the JQL Query: Expecting either 'OR' or 'AND' but got 'Change'. (line 1, character 21)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Work Management

Lessons from Vilius Zigmantas’ path to Continuous Process Improvement at GeoComply

  “Organizations are made of people who create and follow processes which are constantly changing and are in need to be supported and nurtured… this is the spot where I realized I can br...

1,647 views 9 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you