Jira Automation - Worklogs for this year

Natalie Franklin January 31, 2025

Hello all!  I am currently using this 

({{issue.worklog.timeSpentSeconds.sum}} /3600) /8
in my automation which will pull worklogs on an issue and turn it into days and updating a custom field with that.  
I need to pull worklogs just for this current year though...I am having trouble figuring out how to do that...any ideas?

1 answer

2 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.
January 31, 2025

Hi @Natalie Franklin 

For a question like this, context is important for the community to help.  Please post the following:

  • an image of your complete automation rule in a single image,
  • images of any relevant actions / conditions / branches, and
  • an image of the audit log details showing the rule execution.

Until we see those...

I do not know if the worklog smart value in automation rules has a limit for how many entries are available.  Thus, you may want to experiment to confirm if the entire year can be returned.

If they are available, you could use the started attribute with smart value, list filtering to sum just the values for the year based on that date / time value.  Here are some references to help do that:

 

If all of the values are not available, due to the paging limits, you could instead specifically query for the worklogs for the timeframe using the Send Web Request action to call the REST API endpoint: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-get

Please note that endpoint with filtering requires sending the date / time range as UNIX timestamps in milliseconds.

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events