You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi
I plan to use the Log work module in Automation to automatically calculate the work time between when an issue is transitioned (Issue transitioned).
My Automation uses
[When:Issue transitioned]→[Log work]
In Logwork, I use smart values to fill in the Time Spent and Date Started parameters as follows:
Time Spent:{{now.diff(issue.changelog.status[“WIP”].lastUpdated, businessDays.hours)}}h
Date Started:{{issue.changelog.status[“WIP”].lastUpdated.format(“dd/MMM/yy h:mm a”)}}
The main purpose is to calculate the work time from the last update to WIP status to the trigger of Automation as Time Spent. And set the last update to WIP status as Date Started.
However, an error occurred during execution, as shown in the figure:
Hi @Simon Xiao -- Welcome to the Atlassian Community!
Within an automation rule, the {{changelog}} only refers to the fields which changed and lead to the trigger. That smart value does not have any other information from the issue history...which is what you appear to be attempting.
The syntax you show for using the date diff() function is incorrect. Please look here to learn how to use that function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
To do what your scenario is apparently asking, you would need to try: parsing the issue history (based upon REST API calls), parsing the time tracking logs, or use custom fields and math expressions. The complexities in doing this in an automation rule (or by hand) are one of the reasons there are marketplace addons for this need.
Kind regards,
Bill
Hi @Bill Sheboy
I'm very grateful for your reply. Regarding the grammatical issues you mentioned, I will check the support documentation. I'll try your solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Simon Xiao
I expect the issue is with the date notation. Do you instance use the date format as presented in your smart value and is the Date started a date time field, or just a date field?
What you could do is to also set a log action for the time spent and date started field, this will make it easy to debug where the issue is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.