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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you send the screenshot please
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see there is problem with JQL, can you send me the JQL and command you are passing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do that
http://julietta.ikornet.de:8080/rest/api/2/search?jql=%22assignee=currentUser()
or what you need?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.