Why do quotes around dates in this query need to be removed to work?

Deleted user September 9, 2020

(created <= startOfWeek(“-5d”) AND created >= startOfWeek(“-6d”)) OR (created <= startOfWeek(“-12d”) AND created >= startOfWeek(“-13d”)) OR (created <= startOfWeek(“-19d”) AND created >= startOfWeek(“-20d”))

This fails with the following error message.

Duration for function 'startOfWeek' should have the format (+/-)n(yMwdm), e.g -1M for 1 month earlier.

The following query without quotations returns the expected issues.

(created <= startOfWeek(-5d) AND created >= startOfWeek(-6d)) OR (created <= startOfWeek(-12d) AND created >= startOfWeek(-13d)) OR (created <= startOfWeek(-19d) AND created >= startOfWeek(-20d))

 

1 answer

1 accepted

0 votes
Answer accepted
Rob Horan
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.
September 9, 2020

I believe its because that's a syntax requirement.

Deleted user September 9, 2020

Yes, I thought the quotes were a syntax requirement.

This is a sample form an Atlassian blog post https://www.atlassian.com/blog/jira-software/jql-secrets-and-shortcuts

I tried it but it did not work until I removed the quotes.

I am searching for some documentation relating to this...

Deleted user May 3, 2021
(created <= startOfWeek(“-5d”) AND created >= startOfWeek(“-6d”)) OR (created <= startOfWeek(“-12d”) AND created >= startOfWeek(“-13d”)) OR (created <= startOfWeek(“-19d”) AND created >= startOfWeek(“-20d”))

When I enter the above query Jira returns:

"Duration for function 'startOfWeek' should have the format (+/-)n(yMwdm), e.g -1M for 1 month earlier."

When the query is entered without the double quotes it returns the expected results.

(created <= startOfWeek(-5d) AND created >= startOfWeek(-6d)) OR (created <= startOfWeek(-12d) AND created >= startOfWeek(-13d)) OR (created <= startOfWeek(-19d) AND created >= startOfWeek(-20d))

 I have not found an explanation for this behaviour. Are there any JQL experts who understand this?

Rob Horan
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.
May 3, 2021

I got the same error with your statement but no error when I removed all quotes.

(created <= startOfWeek(-5d) AND created >= startOfWeek(-6d)) OR (created <= startOfWeek(-12d) AND created >= startOfWeek(-13d)) OR (created <= startOfWeek(-19d) AND created >= startOfWeek(-20d))

I got no results, but that's because of what's on my instance :)

 

EDIT - and that's what you originally wrote.

Apologies, its been a long monday and I could use a pint...

Like Deleted user likes this
Rob Horan
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.
May 3, 2021

OK this is bizzarre - I can't explain this

watwatwat.png

Like Deleted user likes this
Rob Horan
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.
May 4, 2021

@[deleted]I figured it out!  Your quote character is incorrect.

image (29).png

Like Deleted user likes this
Deleted user May 4, 2021

Good eye!

If I accept your original answer will people be directed to that? Or do you need to submit your solution as a new answer so it's more clear?

Like Rob Horan likes this
Rob Horan
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.
May 4, 2021

There's only the one answer with a lot of replies.  Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events