Forums

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

How can I use the Jira API to get stories I worked on?

Andrew Lighten September 20, 2021

Via the “Your work” menu in the Jira UI I can get stories that I recently worked on. Is that same set of stories available from within the Jira API? I can't see where it is — can anyone nudge me in the right direction?

2 answers

1 accepted

1 vote
Answer accepted
Mehmet A _Bloompeak_
Atlassian Partner
September 20, 2021

Hi @Andrew Lighten ,

For the issues updated by you in the last 10 days, you can use the below JQL. Just replace TheUserName with your jira user name.

issueKey in updatedBy(TheUserName, "-10d")

Then, encode the above jql(eg. using https://meyerweb.com/eric/tools/dencoder/) and append to Jira Rest API as below.

/rest/api/2/search?jql=issueKey%20in%20updatedBy(TheUserName%2C%20%22-10d%22)
Bill Sheboy
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 21, 2021

Thanks, @Mehmet A _Bloompeak_ ...I forgot about that function.

Andrew, please take a look at this documentation to adjust how updatedBy() checks for timeframe ranges to get what you want:

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-updatedByupdatedBy--

Like Mehmet A _Bloompeak_ likes this
Andrew Lighten September 21, 2021

That is perfect. Thanks @Mehmet A _Bloompeak_!

0 votes
Bill Sheboy
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 20, 2021

Hi @Andrew Lighten 

What do you mean by "get stories I worked on"?  Do you mean issues you were assigned to at some point?  If so...

First try this filter to see if it returns what you expect, adjusting your project name and typing in your name to find your ID:

project = myProject AND assignee WAS type-in-your-user-name ORDER BY Key

Now adjust that filter for other criteria you wish, such as timeframe.  You may now use that JQL statement in a call to the REST API:

https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/search-search

Please note that you could also save your filter and have the REST API call it, and also adjust the columns/fields returned.

Kind regards,
Bill

Andrew Lighten September 20, 2021

What I’m after is stories that I edited in some way. Ideally, stories I edited on a specific date. 

Bill Sheboy
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 20, 2021

Thanks for clarifying, and I do not believe that is possible with the out of the box REST API.  You could look at the change log for an issue, but you would need to grab each issue to check.

You may want to check in the developer community to see if someone has solved this another way: https://community.developer.atlassian.com/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events