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

How to get worklog for user for the given date through JIRA Rest api

Deleted user December 31, 2016

Hello!

Sorry if this was already asked and answered, but I couldn't find any suitable answer for my problem.

The story:
I'm currently working on a PHP project what involves a simple doughnut chart what will represent the users worklog for the current day (it's basically a "time tracker"):
worklog_chart.png


What I'm currently using to get this data is the following curl call:

/rest/api/2/search?startIndex=0&maxResults=100&jql=worklogAuthor=test+and+worklogDate=%272017-01-01%27&fields=timespent


and this is the respone:

{"expand":"names,schema","startAt":0,"maxResults":100,"total":1,"issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,renderedFields","id":"10000","self":"https://tisimuvek.atlassian.net/rest/api/2/issue/10000","key":"IRIS-1","fields":{"timespent":43200}}]}


My problem is that this JQL will list all worklogs(aggregated) per tickets/tasks(whatever), but what I want is to only get the list of worklogs for the given user on the given day. Also, if it's possible, I would like to avoid iterating over hundreds of fields returned by the call.

Any ideas on how to do this?


Thank you guys in advance,
Kristóf Tischler

p.s: Please note that using plugins and fetching data from the DB is NOT an option

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Volodymyr Krupach
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 1, 2017

Hi Tischler,

Sorry, but you have to iterate over all returned worklogs and filter them by author. There is no other way based on JIRA REST API.

TAGS
AUG Leaders

Atlassian Community Events