You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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!
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:
project = Operations AND issueFunction in dateCompare("", "created +1w < firstCommented")
issueFunction in dateCompare("project = Operations", "created +1w < firstCommented")
Hope this helps!
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Steve Letch,
if you want to use multi word strings, you always need to quote them, if you are already using double quotes as you are now, you can use single quotes within them.
This would look like that for you:
issueFunction in dateCompare("Issuetype = 'Planned Change' AND created >= startOfYear()", "'Scheduled End' < 'Scheduled Start' ")
Could you confirm this works for you?
Cheers,
Tessa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tessa,
unfortunately this does not work either:
It seems that this function is not well configured because it does not work with fields which have spaces in the name.
I also tried with cf[1234] and other date fields on the system but no luck.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all, I contacted the support and here is the answer for future reference:
"I believe you don't need to add a single quotation for the custom field when using the dateCompare() JQL function."
issueFunction in dateCompare("", "end date > start date+1M")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.