Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

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

(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

I believe its because that's a syntax requirement.

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...

(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?

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 Brad Hu likes this

OK this is bizzarre - I can't explain this

watwatwat.png

Like Brad Hu likes this

@Brad HuI figured it out!  Your quote character is incorrect.

image (29).png

Like Brad Hu likes this

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

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

95 views 0 5
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