Forums

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

Jira Service Desk Track Worklog Time

Simon Maddahi January 28, 2022

Hello everybody,

We use Jira Service Desk to manage our operations. In Jira Service Desk it is already possible to keep a worklog under the item "More options". So each user can log how much time they spend on this process. My question now is if there is a way to get this tracked time using an API. With the Jira Service Desk Server rest API I already get a lot of information under /rest/servicedeskapi/request/(issue_id). However, nowhere in this information is the working log to be found. Do you know how I can read this data?

Best Regards
Simon Maddahi

 

 

1 answer

0 votes
Vishwas
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 28, 2022

Hey @Simon Maddahi 

Welcome to Atlassian Community !!

We can get worklog for issue directly using the GET Worklog API

GET /rest/api/2/issue/{issueIdOrKey}/worklog

Please find the link here https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-getIssueWorklog

Regards,

Vishwas

Simon Maddahi January 28, 2022

Hey,

thank you a lot. 

It works fine. 

However, I always have to provide an ID to get the information. Do you know how I can automate this. like, how do I get all the ID's of all the operations ? Then I can just loop through them and catch the detail data in each case

 

Best Regards,

Simon

Vishwas
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 28, 2022

Hey @Simon Maddahi 

First try to fetch the issues by giving a query like this.

Method: GET Url: rest/api/2/search?jql="assignee=currentUser()"

or rest/api/2/search?jql="project=ABC"

 

This will list the issues of the query along with their ids/issue keys.

So catch them and pass to another GET query mentioned in above answer and run it through a loop.

 

Hope this helps !

 

Regards,

Vishwas

Simon Maddahi January 28, 2022

Hey, i get an Error 400. Bad Request

i get following error by the API:

"an operator is expected before the end of the query"

Vishwas
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 28, 2022

Can you send the screenshot please

Simon Maddahi January 28, 2022

Bildschirmfoto 2022-01-28 um 14.20.07.png

Vishwas
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 28, 2022

I see there is problem with JQL, can you send me the JQL and command you are passing

Vishwas
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 28, 2022

Hey @Simon Maddahi 

I did this way

curl -u username:pwd -X GET -H "Content-Type: application/json" http://35.233.178.116:8080/rest/api/2/search?jql="worklogAuthor=vishwas"

It gave all the issues that I have logged the work.

Regards,

Vishwas

Simon Maddahi February 14, 2022

Hey,

i still getting an error and i don't know why because i use the same statement like you...

 

if i do http://My_Adress:8080/rest/api/2/search?jql="worklogAuthor=my_username"

i get the same error like in the screenshot above..

Bets Regards,

Simon

Jakub Sławiński
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.
February 14, 2022

Simon, can you paste the whole command? Are you using curl, or some other client?

Please simply try (remove "):

http://My_Adress:8080/rest/api/2/search?jql=worklogAuthor=my_username

Like Vishwas likes this
Simon Maddahi February 14, 2022

i will try it out. Thanks. 

Ehm, no i am not using Curl. I am coding in ABAP (SAP) and use a Http Client. 

I send a request to this Link and then i am getting an response

Suggest an answer

Log in or Sign up to answer