Calculation of total time spent per assignee and per issue weekly

Fidelidade JIRA Admin February 24, 2025

Hello,automation_00.pngautomation_01.png

 

 

 

 

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 {{/}}

1 answer

0 votes
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.
February 24, 2025

Hi @Fidelidade JIRA Admin 

There is no "filter" function for smart value lists.  Here are the supported smart values and functions: https://confluence.atlassian.com/automation/jira-smart-values-lists-993924868.html

Instead you could use an iterator and smart value, list filtering: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588

I recommend experimenting with just one issue, writing the results to the audit log, until you get the iteration and filtering to work as needed.

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events