Hello,

I intend to calculate at the end of each week, that is, Friday, the total time spent by a user on each task.
As?
1. On Friday, I want to calculate the time spent by a user on a certain task during the week and place this total in a field called "Weekly Time Spent".
2. Every Friday at midnight, this field is reset and on Monday the count starts again.
I'm using Automation rule to solve this challenge, but I can't get the result. Custom field is not updated.
I'm using two triggers:
1st. When: Scheduled:
a) project = "Jira & Confluence Support"
every 1 Days
b) The "Weekly Time Spent" field is edited and the following calculation is made: {{issue.worklog.entries.filter(wlog -> wlog.started.isAfter(startOfWeek())).sum(wlog -> wlog.timeSpentSeconds).divide(60)}}
2nd. When: Work logged:
The "Weekly Time Spent" field is edited and the following calculation is made:
{{#=}} {{issue.worklog.entries .filter(wlog -> wlog.started.jiraDate >= startOfWeek().jiraDate) .sum(wlog -> wlog.timeSpentSeconds) }} / 60 {{/}}
Does anyone have any idea how I can solve this challenge?
Thanks,
Emanuel
Error message:
Error rendering smart-values when executing this rule:
Failed to get value for issue.worklog.entries .filter(wlog -> wlog.started.jiraDate >= startOfWeek().jiraDate) .sum(wlog -> wlog.timeSpentSeconds): {{#=}} {{issue.worklog.entries .filter(wlog -> wlog.started.jiraDate >= startOfWeek().jiraDate) .sum(wlog -> wlog.timeSpentSeconds) }} / 60 {{/}}