Forums

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

How can I reset the worklog via an Automation?

Dominique
Contributor
January 27, 2022

I want to reset the worklog to "0" in certain situations but am unable to find out how to do it.

Untill now I was able to add a certain amount of time, by the following:

{
  "update": {
    "worklog" : [
      {
        "add": {
          "timeSpent" : "6m"
        }
      }
    ]
  }
}

but when I replace "add" by "set" and 6m by 0m it does not work.

 

Anyone out there how knows how to do it?

 

Thx in advance! 

2 answers

0 votes
Mélanie Liguet
Contributor
September 21, 2022

Hi @Dominique Hermens , 

 

Do you resolved it ?
I have the same issue.
i need to remplace a worklog with a new value.
I can only add a new worklog , i can't edit or set it.

 

regards,

Dominique
Contributor
September 21, 2022

@Mélanie Liguet not yet unfortunatelly. 

Bill Sheboy
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.
September 21, 2022

Hi!

I have not tried this, and I believe you can do this by repeatedly calling the REST API with a web request to delete each entry, in an advanced branch, as Rilwan described below.

Here is an updated reference to the method and a how-to article for calling an API from a rule:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-id-delete

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events