I have an issue that I can't seem to solve.
Scenario:
A user is creating a request and we have a checkbox list of items they can select 1 to all items, these represent tasks that they need to be completed in the request.
We then need an automation that goes through all the selected options adds different amounts to the Original Estimate and has the total number be the final outcome.
Issues:
- Whenever I try to list a series of if/else conditions OR even create many small independent automations, it seems that the value of the field I am adding to doesn't update so it just adds to what was there before the automation is ran.
- Example:
- The setup
- Original Estimate = 0 at the beginning
- There are two options selected
- Option 1 should be 1 hour
- Option 2 should be 1.5 hours
- I use if conditions to check if the options are selected.
- I use any number of ways to add a value, but the best is: {{#=}}{{timetracking.originalEstimateSeconds.plus(3600)}}/60{{/}}
- I update both Original Estimate and Remaining Estimate
- Expectation: it would hit the first one, change the value to 1 hour, hit the second, and add 1.5 hours to make it be 2.5 hours.
- What really happens: It changes the estimates to 1 hour in the first check, but then when it goes to the second, it still uses 0. So instead of adding the amount to 1 it adds it to 0 and moves on. This effectively makes it only be the value from the last check that is run.
- When you try to add to an estimate field if you first add the number it will then multiply the entire amount by 60
- Example:
- Setup:
- The first run-through adds 60 (thinking it will be 60 minutes)
- The estimate shows 1 hr
- In the second run-through, you want to add 1 more hour so you add 60 again
- Expectation: After the second run-through, it would show 2 hours.
- What really happens: After the first, it takes the 60 multiplies by 60 equalling 3600 (how many seconds are in an hour). The second round takes 60, adds it to 3600 to get 3660 then multiplies by 60 again so you get 219600 which is 219600 which equals 1 week, 2 days, and 5 hours.
I was going to try to use Variables but there doesn't seem to be a way, that I can find, to dynamically update the value of a variable and have it then be pushed into a field.
All I need is to have a reliable way to check all options selected and add the corresponding hours to the estimates. Does anyone have any ideas on how to do this?