Retrieve Logged work per day&user from API

Our programmers have tol log all the work they do on Jira issues. 

I want to create a script (bash/php/whatever) that runs daily to check if every programmer logged enough hours.  It should work something like this

  1. Get date
  2. Get user
  3. Find all the logged hours for this date & user 

 

I already do this on our self hosted Jira instance, but I use the 'RESTful Worklog Query'  add-on for that.  This addon is not available for the cloud.

I have read through the docs, but this doesn't seem to be possible? 

Any thoughts on this?

 

1 answer

This widget could not be displayed.

I can't see clear way to input a user and a date in order to get back all that I think you are looking for here in a single call.

However there are two different REST endpoints that you could use to find this out.   First you would need to find all the worklog ids.  You can use the /rest/api/2/worklog/updated endpoint to do this.  That REST endpoint has an optional parameter, it is a unix time value. If supplied the REST call only returns the worklogs since that time supplied.   My thought is that you could run this REST call everyday with a changing time parameter as to some time from yesterday, or 24 hours ago in the unix epoch time.

With the results of that, you can then see all the worklog ids.  You would need those ids in order to then use the rest/api/2/worklog/list endpoint.   If you make that call and supply it all the ids you got back from the first call in order to see all the worklogs via rest for all users during that time.

I know this isn't exactly what you are looking for here, but this is one way that you could use the REST API in order to get this data in a raw form.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

216 views 3 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you