Remove all work log with automation (clean the work log)

Florian PEREZ
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 7, 2023

Hello , I’m looking at a way to automatically clean work log under a ticket on cloud instance of Jira

Automation does not the trick, we can only add work log
API rest does not seems to work, I’ve already tryed a delete method on the work log endpoint and got a unauthorized method response.

Anyone have a solution for this ?

3 answers

2 accepted

4 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2023

Hi @Florian PEREZ 

You should be able to delete worklogs with API. What is the response number you are getting? 401?

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2023

@Florian PEREZ 

To answer to your reply, the endpoint you have to use to delete a worklog is:

https://yourdomain.atlassian.net/rest/api/3/issue/ISSUE_ID/worklog/WORKLOG_ID

and not /rest/api/3/issue/{{issue}}/worklog 

You can't delete all worklogs right at the get go. You have to provide the worklog id and then delete a specific worklog. I've tried on my instance the above endpoint I mentioned and everything works fine.

worklog rule.png

 

worklog rule audit log.png

Like Bill Sheboy likes this
Florian PEREZ
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 8, 2023

Hello, after a deeper dive I can confirm we can’t delete all the work logs in one time. There’s no end point to do this with api. 

I was having another problem by not encoding my username with my api token password when encoding to base64. Rookie mistake here.

I successfully delete the work log if I only got one worklog on my issue. This can fit the need so I’ll not go further on this !

Many thanks !

1 vote
Answer accepted
Florian PEREZ
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 8, 2023
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2023

Yup, I wrote it based on your question :) 

Like Florian PEREZ likes this
Florian PEREZ
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 13, 2023

You’re the best ! 🥳

0 votes
Florian PEREZ
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 7, 2023

I'm using the https://projectbaseline.atlassian.net/rest/api/3/issue/{{issue}}/worklog endpoint and it seems not accepting Delete method to kill all the worklog. 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/

 

when I use the endpoint on Automation I get wrong method response. 

I think there no way to delete all worklog at once.

2023-01-08 00_37_00-.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events