The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to update worklog to be difference between original and remaining time

Gordon McDonald
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 20, 2022

I'm using an app to update the time tracking field from excel but unfortunately it can only update original estimate and remaining time, and not log time worked.

As a workaround, I would like to make an automation that fires up whenever time tracking is updated, and updates work time logged to be the difference between original estimate and remaining time.

 

I've tried the following but it fails. How can I fix it so that time already spent is updated as the difference between original estimate and remaining time?

 

Screen Shot 2022-06-21 at 11.50.26 am.png

Additional fields:

{
"update": {
"worklog" : [
{
"set": {
"timeSpent" : {{issue.timetracking.originalEstimate.diff(issue.timetracking.remainingEstimate).hours}}
}
}
]
}
}

 

Error that I get:

Screen Shot 2022-06-21 at 12.01.49 pm.png

 

Extension I am using to update time tracking column: Excel 365 connector for JIRA  

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
James Navin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 27, 2022

Hi @Gordon McDonald ,

My guess is that the smart value expression you are using is not evaluating to a number and so the resulting JSON is not valid (as detailed in the error you are seeing).

I would suggest you start by debugging the smart value expression to ensure it is doing what you think it's doing. There are some options described in https://support.atlassian.com/cloud-automation/docs/debug-an-automation-rule/ for how to debug a rule.

Once you have ensured the smart value expression is working as you expect then you should be able to update your rule.

Something like the following would be a good starting place:

Screen Shot 2022-06-28 at 11.30.18 am.png

Cheers,

James

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events