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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Our organisation use Timetracker for log working time.
Timetracker use standart worklog and estimate time.
We have 2 type of users - new and old.
We have project with sick\leave task for every users. When they need vacation or sick they log time to this their tiket.
New user
In half year from their start have +5 Days for vacation\leave and + 0,5 year - add +10 Days. And every half year after their start they have +5 Days and year +10.
Maximum 15 days total.
Old user
1st january have +15 days for the year, and every year it refresh.
HR asked me to create system based on this tickets - show how much Days (vacation\leave) everybody have.
I created custom fields
Days - for calc days, how much it left
DaysOff - for calc how much days they Used
AddsCounter - is stop for add everyday Days (1 or 2)
Also for every User we add StartDate in tasks. For New its day of their start. For Old we set this date as 01.01.2021
DueDate - I use for check how much time spent, and i change it on {{duedate.plusyears(1)}} when it spent 1y and we add them +10 Days
1st script easy:
For correct Days no more than 15. If something not used and total stay >15.
2nd script add +5 Days (0,5y) +10 Days (1y) and I added - AddsCounter wich = 1 or 2. It sheduled on everyday at 9 am
1st part its for New users and Old(DueDate alwas 01.01.20XX)
It set UsedDays - 0 AddCounter - 0 and when DueDate > 1y than today it change it too.
This 2 scritps working, maybe I will optimise it.
I have issue with calc Days when guys Add, Del it or change.
3rd script
It correct Days and UsedDays when somebody changed worklog (Timetracker)
" {{Days}}-{{#issue.worklog.timeSpentSeconds.sum}}{{fromString}}-{{toString}}{{/issue.worklog.timeSpentSeconds.sum}})/28800
{{UsedDays}}+({{#issue.worklog.timeSpentSeconds.sum}}{{fromString}}-{{toString}}{{/issue.worklog.timeSpentSeconds.sum}})/28800 "
Need +Days when worklog minus
And +UsedDays when worklog plus
And edit to + or -.
Log show me
I dont know how to do it. I want to do it but math not helped.
{{#=}}{fieldA}}+{{fieldB}}{{/}}
First of all, you can use number fields for your Days and Daysoff fields.
I would implement a "Log action" step after every step in your Automation rule, so you can see, what's happening in the background.
As @Bill Sheboy said, you'll have to indicate, that you are defining a math expression.
Have a nice day,
Bela
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Denys Mokhynia -- Welcome to the Atlassian Community!
It can help for a question like this to include an image of the audit log details for the rule execution. That will provide context for where the error is happening in the rule.
Next, you are trying to set values using mathematical expressions. Please try wrapping those with the math operator, such as like this:
{{#=}}{fieldA}}+{{fieldB}}{{/}}
The specific error you show seems to indicate a missing parenthesis in the expression. Please check if those are all paired up correctly.
Finally, this is a complicated use case for automation rules. I recommend periodically writing the expressions to the audit log to confirm they are working as you expect. That may help narrow down where the problem exists.
Kind regards,
Bill
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.
How Can I check worklog
If I have 2 worklog days
I loged 1 day
How i can calculate this 1 day
{{#worklog.timeSpentSeconds}}{{fromString}}-{{toString}}{{/worklog.timeSpentSeconds}}
This formula?
I want to understand if I add 1d
system +1
If I minus 1d
system -1
or it always will show 1 without "-" or "+"
I need when worklog created +1d
Days -1d
UsedDays +1d
When worklog delete -1d
Days +1d
UsedDays -1d
When worklog edited "+0,5d" or "-0,5d" (1d,2d etc)
System understand it and
"+" or "-" Days, UsedDays
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First thing: please try to stick to one conversation thread when responding. Otherwise it becomes difficult to follow and readers often understanding that each thread is a solution approach to try. Thank you.
You note that you tried the math operation syntax and that did not work. Please post images of your current rule, showing your use of the math operation. That may help to explain what is happening.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I think I wrote what I need.
I add math model, yes it not gived errors but Days it calculate correct when I deleted worklog, it showed it do "-1". But UsedDays the same formula not counted, at all
{{#=}}{{Days}}-({{#issue.worklog.timeSpentSeconds}}{{fromString}} - {{toString}}{{/issue.worklog.timeSpentSeconds}})/28800{{/}}
{{#=}}{{UsedDays}}+({{#issue.worklog.timeSpentSeconds}}{{fromString}} - {{toString}}{{/issue.worklog.timeSpentSeconds}})/28800{{/}}
It look like it missed 2nd rule
Maybe I explain wrong.
I need bulid 1 rule for my system that understand and calculate 2 custom fields
Days and UsedDays, as i wrote in last message.
I understand, I think, how it should be when users add worklog and delete worklog(I'ill build 2 rules with create and delete worklog). I think it show mistakes but it will work. But if user edit worklog (2d to 1d), I understand that I will have mistakes in my system. And I want build 1 rule or 3 for Create, Deleate and Edit worlklog. And system should understand
+ or - Days and UsedDays.
Can u help me with it? If no, so ok. I missied understood rules of best Atlassian community.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the only case that is not working correctly when a user edits a worklog to decrease the value, such as 2d to 1d? Or are there more?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, in this case
When user add worklog (use timetracker, its the same work as u do it by Jira instruments, but more comfortable), I can create rule
1st
Create worklog (its +)
Days will be minus
UsedDays will be plus
2nd
Delete worklog (its -)
Days will be plus
UsedDays will be minnus
How to create rule for situation when user edit their worklog, I dont know. He can change from 1.5d to 1d or from 1d to 1.5d. 0.5d to 1d etc.
We did restrict no more that 12h (1.5d) logs per day. But its will not change situation)
So i am thinking about that some IF operator use
If user change worklog, is it more or less than last value. And depend of result what user have done it always correct calcilate. If i solve this last issue It cover full actions with work log.
Than nothing matter +, - or edited user worklog. It always will be correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for clarifying. I am unclear why this would not work so perhaps you can explain further. For example, your rule is setting...
Days = current Days - (worklog change of fromString - toString)
And so that should work correctly if your values are increasing or decreasing, right?
Increasing: worklog was 1d and is now 2d leads to: current Days - (2d - 1d)
Decreasing : worklog was 2d and is now 1d leads to: current Days - (1d - 2d)
I recommend writing all of the values to the audit log before and after the math operation to confirm what is happening:
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.