Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

get updated and newly created issues in a project based on a time criteria

Andy Hint February 14, 2018

Hi,

I am looking to get updated issues in a project..., with changelog expanded

 

queries I have used -->  

https://jira.../rest/api/2/search?fields=*all&jql=project=...&updated>-7d&expand=changelog

https://jira.../rest/api/2/search?fields=*all&jql=project=...&updated?since=1517464800&maxResults=100&expand=changelog

https://jira.../rest/api/2/search?fields=*all&jql=project=...&updated<="-7d"

All three queries provide output that seem to have issues that are recently updated, but are not following the 'updated' since constraint (getting issues older than 7 days for 1st query and older than Feb 1st 2018 for the 2nd query (unix time)).  

I came up with the 1st query based on the scenario at https://community.atlassian.com/t5/Jira-questions/getting-the-latest-changed-issues-in-a-project-via-rest-api/qaq-p/241295#U727498 --> project='REC and updated > -1h';

I came up with the 2nd query based on the documentation (as pictured below) from https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/worklog-getIdsOfWorklogsModifiedSince

 I came up with the 3rd query based on the recommendation at https://community.atlassian.com/t5/Jira-questions/How-can-i-get-last-one-hour-updated-or-last-half-an-hour-updated/qaq-p/313340

None of the queries are following through on the 'updated' constraint, which is very crucial for my purposes.

Any suggestions are appreciated.  I am working on JIRA v7.2.10.

Regards,

ids of worklogs modified since.PNG

1 answer

1 accepted

1 vote
Answer accepted
Danyal Iqbal
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.
February 14, 2018

updated<="-7d" works like it is supposed to, atleast in the front end.

it looks like you need to adjust your jql. Use the advanced search to see the results of your jql. Hint: add updated column to the seach results  and an order by clause to make it easier.

Andy Hint February 14, 2018

Hi,

 

Thanks for the quick response.  Yes, if I use 'project = xxxx Created > -7d' in Issues (in header) > Search for issues.... jira search.PNG

I can get the issues created in the last 7 days.  

However, I am doing an extract via python, inputting query parameters within the url.  In this process, I am getting an output of 50 issues (below dates and frequencies)

{'2018-02-13': 2, '2018-02-09': 2, '2018-02-08': 2, '2018-02-07': 8, '2018-02-05': 1, '2018-02-01': 2, '2018-01-31': 4, '2018-01-29': 4, '2018-01-27': 1, '2018-01-26': 1, '2018-01-25': 3, '2018-02-02': 2, '2018-01-19': 3, '2018-02-03': 1, '2018-01-17': 5, '2018-01-12': 2, '2018-01-10': 6, '2018-01-09': 1}

the dates range from 02-13-2018 to 01-09-2018.

The issue count adds to 50

==> when I do search via project and created on the jira website for the same project, I get just 5 issues.... all of which were created in the last week.

 

The question being:  how can I modify the URL such that the updated and created criteria could be enforced.  

Once again, thank you for the quick response.  Any suggestions are appreciated.

Regards,

Danyal Iqbal
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.
February 15, 2018
Andy Hint February 15, 2018

Hi,

Thank you for the suggestion above.  Works well.

 

Below are the two queries I will be using based on the template above... added few things.... (*all --> gives all fields, maxResults=500, & expand changelog...) 

https://servername.com/rest/api/2/search?jql=project=name%20and%20created%20%3E-7D&validateQuery=true&fields=*all%20&maxResults=500&expand=changelog

https://servername.com/rest/api/2/search?jql=project=name%20and%20updated%20%3E-7D&validateQuery=true&fields=*all%20&maxResults=500&expand=changelog

 

One small question... when I run the two queries above... 1st one being 'created' and the 2nd one being 'updated', I get two outputs (5 issues created and 6 issues updated).  For the updated issues, they also include the 5 issues recently created.  My question is... is the 'updated' parameter encompassing those issues recently created and old issues recently updated...?

 

Thank you for the help,

Anand

Danyal Iqbal
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.
February 15, 2018

My question is... is the 'updated' parameter encompassing those issues recently created and old issues recently updated...?

 

Yes. It contains both recently created issues and recently updated issues.

Andy Hint February 15, 2018

Thank you,

Regards,

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events