getting the latest changed issues in a project via rest api

ashen shanaka January 31, 2013

hi

i have a requirement of getting the issues that were changed recently in a project via rest api.having only the issue names is enough for me. i think expand changelog should do it.but it is only defined to get the history of a issue.i need something else.is this possible? if so how?

4 answers

1 accepted

0 votes
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
January 31, 2013

Normally you just need to use JQL to find all the issues changed within some time range. Something like:

project = xxxx and updated > -10d and updated < -3d

Use that on a rest api call or getIssueList

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
January 31, 2013

d = day, h = hour, m = minute. Standard JQL time values.

ashen shanaka January 31, 2013

thanks bob..can you tell me whats -3d? how i use it if i need to get issues that were updated within 1 hour?

ashen shanaka January 31, 2013

so if i want the issues within 1 hour time period my jql would be...

project = xxxx and updated > -1h

am i right?

Like Anas ait Baha likes this
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
January 31, 2013

Yes, changes in the last hour.

Like Anas ait Baha likes this
Jozef Kotlár
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.
January 31, 2013

Yes, for more information see JQL Documentation

ashen shanaka January 31, 2013

im getting more than 50 results.but in my activity history theres only no more than 10 tasks which i have changed..

Jozef Kotlár
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.
January 31, 2013

project = xxxx and updated > -1h

returns issues updated by anybody, if you want to get only issues updated by you that's another question, that is not fully available from JQL - see limitations of operator CHANGED

Ben Rivera February 8, 2021

how would you search what issue was updated last.

 

I am trying to search my active projects that are not being used anymore.

 

I want to archive or remove projects that were not used.

1 vote
Jozef Kotlár
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.
January 31, 2013

Have a look at tutorial for querying using REST, using abovementioned filter.

ashen shanaka February 5, 2013

hi

im sorry if i sound like a complete newbie.im using this library to query JIRA using rest api. but when i gave the above mentioned jql, it returns all the issues in the project. could you look in to and tell me how my code should be like? i used the following.

in the index.php

$query->project='REC and updated > -1h';

$queryIssue = new Jira($config);
$commentarray=$queryIssue->queryIssue($query);
$commentresponse=json_decode($commentarray->responseBody);

echo "<pre>";
print_r($commentresponse);

thankyou

0 votes
Andy Hint February 13, 2018

Hi,

I am also 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

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

I came up with the 1st query based on the scenario above --> 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

 

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

Any suggestions are appreciated.

Regards,

ids of worklogs modified since.PNG

Andy Hint February 13, 2018

small update:  working on JIRA v7.2.10

Jason Howard-Carter September 7, 2018

@Andy Hint did you resolve this issue? - I'v experiencing a similar issue

0 votes
ashen shanaka February 6, 2013

thanks everyone for giving me such a great answers. the problem was i didint use post function. it seems that when querying more than 1 condition the get function only takes the 1st argument.by using post i was able to do this. thanks everyone.

Suggest an answer

Log in or Sign up to answer