Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

JQL for Filter by date range

Currently I'm running the following query to retrieve update tickets from within a specific date range. I've tried it 5 different ways. However none of them seem to work.

 

https://url.atlassian.net/rest/api/2/search?jql=project=XYXY&updated>=2018/10/01andupdated<=2019/11/01&maxResults=10;

 

2 answers

1 accepted

3 votes
Answer accepted

I've resolved the issue. To overcome this problem you need to append the date range with Project name rather than &updatedDate>=startOfWeek(-1) AND updatedDate<=startOfWeek(-1) .

It should be project=XYXY%20AND%20updatedDate>="2018-11-25"%20AND%20updatedDate<="2018-11-30 along with quotes

How finicky, I got it to work with 

updatedDate>="2018-11-25"%20AND%20updatedDate<="2018-11-30"

without the project

TY

0 votes
Deleted user Nov 25, 2018

Hi @Madura Bashana,

I have tried with the above URL and I'm able to retrieve the JQL results.
Can you please verify the domain of your site and check the permissions to view the issues.

Regards,
Kishore Kumar Ganagvath.

Mine doesn't work, However i can retrieve data through that query, but not related to the mentioned date range. For example if i want only between 2018-10-01 and 2018-10-30 it only has results with 11th month.

Deleted user Nov 26, 2018

Hi @Madura Bashana,

Use your system date formate in the JQL filter. For example: updatedDate  >=  "2018/10/01" and updatedDate   <= "2018/10/31" (dont forget the quotes).
If it's not working then share us the error message.

Regards,
Kishore Kumar Gangavath.

Hi @[deleted]

This is my current query, 'https://url.atlassian.net/rest/api/2/search?jql=project=XYXY+order+by+updated&maxResults=10&fields=*none&updatedDate>=\"2018/11/01\" and updatedDate<=\"2018/11/31\"'";

It's giving HTTP/1.1 400 BAD_REQUEST error. 

However without based on specific days, can we filter it by based on weeks. 1wk or 2wk.

Hi @Madura Bashana,

The 400 BAD REQUEST  error gets for many reasons, some of them are related to the "Invalid URL" or "expired local cookie". Try to clear relevant cookies and then try.

Yes, you will be able to retrieve the issues based on the weeks also. You need to use the "startOfWeek()" parameter in the JQL filter. For example, if you want to retrieve the issues between last 8th week to 4th week here is example JQL.

updatedDate  >=  startOfWeek(-8)  and updatedDate   <= startOfWeek(-4) 

This may help to get the results.

Regards,
Kishore Kumar Gangavath.

Hey@[deleted]

Did that work for you ? Cause tried, it doesn't seem to work. I' ve tried it in two different ways,

1. https://url.atlassian.net/rest/api/2/search?jql=project=XYXY+order+by+updated&maxResults=10&fields=*none&updated>=-1w

2. https://url.atlassian.net/rest/api/2/search?jql=project=XYXY+order+by+updated&maxResults=10&fields=*none&updatedDate>=startOfWeek(-1) AND updatedDate<=startOfWeek(-1) 

currently rather than running through this my script, i'm just manually executing the url

Like Imadedine Jerbi likes this

Suggest an answer

Log in or Sign up to answer
TAGS

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