Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can you do IF Statements in Trello Automations?

Ashish Dobriyal
Contributor
December 7, 2023

I have 3 custom fields Estimated Time, Actual Time and Priority. I want to do an if statement such as If Actual Time/Estimated Time = 0.5 or less then Set Priority to Low. If Actual Time/Estimated is between 0.5-0.75 then set priority to Medium and if its above 0.75 set to High. Is there a way to do this with automation if there isn't is there a Powerup that can help with it.

Thanks

2 answers

1 accepted

0 votes
Answer accepted
Daydreamer Mike
Community Champion
December 10, 2023

Hi @Ashish Dobriyal 

think you can do this best with an additional custom field, for the example below, I called it Variance

You will require a few rules:

Rule 1 

when custom field "Estimated Time" is set in a card with custom field "Actual Time" set, set the custom field "Variance" to ({{%Actual TIme}} / {{%Estimated Time}}) *100

Note, I have made the variance figure in % to make it more usable...You can remove the *100 part if you don't want it as a %?!

Copy this rule and change the trigger to 

when custom field "Actual Time" is set in a card with custom field "Estimated Time" set,

This will ensure the rules don't trigger with an empty field...


Rule 2

This will require copying for the 3 conditions you set.  I will write the rule once for the middle one...

when custom field "Variance" is set to a number greater than 10 and lower or equal to 75, set the custom field "Priority" to Medium
Ashish Dobriyal
Contributor
December 11, 2023

This works perfectly. Thanks.

MC April 6, 2024

Ashish, does "When" still count against your monthly automation count even when it doesn't satisfy the rule?  For example...

 

when custom field "Variance" is set to a number greater than 10 and lower or equal to 75, set the custom field "Priority" to Medium  

 

So if "Variance" number is say 100, then it won't automate correct?  Therefore, it won't run and count against your Monthly automation count?

Daydreamer Mike
Community Champion
April 6, 2024

Hi @MC 

You are correct, there is no reason for that automation to trigger...

0 votes
Hannah Humbert - Simpla Workflows
Community Champion
December 7, 2023

@Ashish Dobriyal it is possible to have your trigger say "when custom field Actual Time is set to a number lower or equal to 0.5". Is that what you want? Or are you looking to have estimated and actual time combined somehow in the same rule?

Ashish Dobriyal
Contributor
December 7, 2023

@Hannah Humbert - Simpla Workflows you won't be able to do it like that. Actual Time and Estimated Time are in Days so it would be like for example Actual Time is 4 and Estimated Time is 10 so 4/10 is 0.4 so it should be set to low priority.

Hannah Humbert - Simpla Workflows
Community Champion
December 7, 2023

Right, I see, so you're basically wanting to say:

"when the "Actual Time" field is set, divide by the "Estimated Time", and if value is 0.5 or less then Set Priority to Low, ... etc."

Did I get that right? 

I'm not sure it's possible to accomplish this all within one rule, however. The first thing that comes to my mind is to create another numerical field to host this calculated value, then create a separate automation to calculate the two fields first (see custom field arithmetic). Then once your value is populated in this field, you can use this as your trigger to set the priority. 

Ashish Dobriyal
Contributor
December 7, 2023

Yes, that's what I want it to do. I'll check out the Custom Field Arithmetic. Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events