Forums

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

how can we get logged hours for main story ,sub-tasks and bugs in a single rest API?

Sahil Gupta April 22, 2019

Hey guys,

I need to know weather we can get sub-task and bugs time tracking for a single user. 

As of now, when I am calling JQL search Api for logged hours of a user, I am only getting time logged in main story. There is no logged hours present for bugs in issue-link field.

Is there any other Api which can provide time logged against a link-issue in JIRA along with the time logged for main story.

 

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2019

Hello Sahil and welcome to the Community!

To ensure I’m understanding correctly, you’re wanting to view all logged hours from a specific user for all issues types and subtypes. The difficult part is that you’re wanting to get all of this via one single REST API call. I went through the Jira cloud REST API endpoints and most of what I found is a staged approach to collect this data. Meaning you will have to phase into this with the following steps:

  1. Locate all of the issues that the user recorded a worklog OR locate all issues with the user assigned
    1. GET /rest/api/3/search
  2. Scrub all of the IDs from those issues
    1. This would be a scripted process.
  3. Request the worklog info from all of the scrubbed issues by ID
    1. POST /rest/api/3/worklog/list

Executing these steps will be dependant on which scripting language you use and how you choose to access these endpoints. This should assist with gaining access to the users worklogs to get a recorded time.

I hope this proves helpful and you’re able to locate and access the data you need.

Regards,
Stephen Sifers

Sahil Gupta May 1, 2019

Hello Stephen

Thank you for your answer.

I am already using same approach. But I have a list of users for which I need to calculate the total time spent by him for all the issues. When I follow the above approach it takes more response time. 

As I have to  first calculate the issues of a single user and then by processing it we will find issues id's and corresponding to that we are calculate workLog. Again i have to process individual time to calculate total time spent for the issues.

 

In a case where I have multiple users,this whole calculation takes a lot of time.

Looking for a way, so that I need not pass individual issue id's and its type to calculate the workLog.

 

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events