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?

Additional fields:
{
"update": {
"worklog" : [
{
"set": {
"timeSpent" : {{issue.timetracking.originalEstimate.diff(issue.timetracking.remainingEstimate).hours}}
}
}
]
}
}
Error that I get:

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