Using Butler to change label based on custom field date's aging
Asked by eric_bouchet:

Hello,

I have a date set as a custom field (1st meeting), and I was hoping to be able to use that information to set a card label to reflect the distance from this date, as time moves :

* if 1st meeting \< 30 days, label Green
* if 1st meeting between 30 and 60 days, label Yellow
* if 1st meeting more than 60 days, label Red

I understand this cannot be a rule, since it would only execute once, when we set the date, right ? And I need the status to change with time.

Butler's board button or calendar-based actions do not seem to offer this type of action around custom fields.

Did I miss something ?

Before you ask, I cannot use Trello's regular Due Date field, as it is already used by another date.

Thanks in advance  
Eric


Answers:
author: Esme Crutchley
body: Hi [@eric_bouchet](/t5/user/viewprofilepage/user-id/3901025)

Welcome to the Community!

Okey dokey! This can be achieved in Butler but there are 3 rules that you need to make. I'll start from the beginning.

When you create a card and set the first meeting CF, we want to add the green label - this can't be any other kind of rule because it has to be added on creation otherwise it won't work:

![Screenshot 2020-05-04 at 07.44.45.png](https://community.atlassian.com/t5/image/serverpage/image-id/93270iBBD0EFF3DA51615C/image-size/large?v=v2&px=999 "Screenshot 2020-05-04 at 07.44.45.png")So in this rule, we're saying that when the CF is filled out, it will add the green label. Meaning that you can add as many cards as you like for 'leads' and they won't count until you put the CF in.

Then we want to address the yellow rule. The trigger needs to look like this:

![Screenshot 2020-05-04 at 07.43.12.png](https://community.atlassian.com/t5/image/serverpage/image-id/93273i3C704C36D40963B9/image-size/large?v=v2&px=999 "Screenshot 2020-05-04 at 07.43.12.png")

Then you want to remove the green label and add the yellow one:

![Screenshot 2020-05-04 at 07.48.53.png](https://community.atlassian.com/t5/image/serverpage/image-id/93271i777E6BF069CC5390/image-size/large?v=v2&px=999 "Screenshot 2020-05-04 at 07.48.53.png")

Then for the last one, the red command, you want to:![Screenshot 2020-05-04 at 07.40.19.png](https://community.atlassian.com/t5/image/serverpage/image-id/93274i32AEA49027968173/image-size/large?v=v2&px=999 "Screenshot 2020-05-04 at 07.40.19.png")

Then remove the yellow label and add the red:

![Screenshot 2020-05-04 at 07.42.36.png](https://community.atlassian.com/t5/image/serverpage/image-id/93276i353FBA8EE342D964/image-size/large?v=v2&px=999 "Screenshot 2020-05-04 at 07.42.36.png")

From what you've said, I think this is what you were wanting to be able to do.

Please, if I'm totally wrong, let me know and we'll try this again!

Esme :)

comments: author: eric_bouchet
body: Hello [@Esme Crutchley](/t5/user/viewprofilepage/user-id/3555478),

Thank you very much for your detailed answer. However I fear this might not work, as I cannot use the Due Date field for these calculations.

To be specific, I do need 2 date fields : the custom field with be used for the 1st meeting date, and serve as a reference, and Due Date will be used for the next meeting to occur, and will be synchronised with the Calendar.

Let's assume I have a 1st meeting today May4th. The card would have the green label for the next 30 days. Then on June 4th it would automatically have the yellow label. And on July 4th it would move to red label.

With Butler's rules, I understand there needs to be some action for the rule to happen. In this case, the only action is time. The date is set on May 4th and does not change.

Does this make a difference in your proposal ?

Thanks in advance

Eric :)


author: eric_bouchet
body: OK I might have overworked this a bit, due to a literal interpretation of what "set" means in Butler's triggers. I assumed that "set" means "the instant the data is entered", and it seems it just means there is a value ?

So I created 3 simple rules that say:

* when custom field "1st meeting" is set to a date between 1 and 30 days ago, add the green label to the card

* when custom field "1st meeting" is set to a date between 31 and 60 days ago, add the orange label to the card

* when custom field "1st meeting" is set to a date more than 61 days ago, add the red label to the card

*Of course complete rules will have to include previous labels removal*

Does this sound OK ? Or is it too simple this time ?

Eric


author: Esme Crutchley
body: Nope! That sounds awesome!

Yeah, set just means there's something in there, it's not the greatest explanation in the world, I'll give you that!

I have worked with Butler on my boards for over a year, and I often think that I *overthink* the rule, so I go for simple every time now!

Run with that on your board for a while and see if that does what you want it to, you can always tweak it later if it's not performing how you wanted it to.

Feel free to come back and ask more questions or tinkering tips, that's what we're here for!


author: eric_bouchet
body: Well, well...

So I have set up those 3 rules to test the idea, and they do not seem to be working as expected :(

![rule1.png](https://community.atlassian.com/t5/image/serverpage/image-id/93607iEE6BD7D05BA3DA3C/image-size/large?v=v2&px=999 "rule1.png")On Monday May 4, I created 3 cards with different dates : May 2, 3 and 4, to rapidly see different labels colors.

It seems it picked Green correctly, as it happened at the creation of the card, but Orange and Red do not seem to come.

![rule2.png](https://community.atlassian.com/t5/image/serverpage/image-id/93608i6037999E2ACA45AB/image-size/large?v=v2&px=999 "rule2.png")

I am unclear if rules are supposed to run in the background, like "always", since in this case the Trigger is just a time event, so it has to check all time until the condition is met.

Any further idea ? I was thinking of using a Calendar-based Butler to move cards to a temp list to change the label color, and then move them back to their original list, but not even sure I could keep track of the original list... Just an idea to overcome some of the (perceived) limitations.

Thanks in advance


author: Esme Crutchley
body: Hi Eric,

What are the due times? I would assume that the trigger will only happen when the due time has passed, e.g. if the due time is 7pm in the custom field, then the label will only trigger after 7pm.

Could you have a quick look at that and see if that's the issue?

E :)


author: eric_bouchet
body: Hello [@Esme Crutchley](/t5/user/viewprofilepage/user-id/3555478),

Sorry for the delay. I keep running into circles on this topic.

I guess I am using the wrong triggers. I am expecting the label change to happen **automatically over time** , but if I understand correctly Butler **Rules will only run based on an action Trigger**, i.e. somebody changing the content, right ?

To put things back : Trello's Due Date field is already in use, so I am ruling this one out. What I am looking at is the 1st Meeting custom field, that is set to some date in the past. TODAY the card will have a green label. In ONE MONTH the label will change *automatically* to orange, and in TWO MONTHS it will turn red. This sounds more like a Butler Due Date command, but I cannot use Due Date. I was thinking of having a Calendar command with a daily check, but I cannot find anything related to custom fields in the Calendar command :(

Any idea ? Should I force a copy of my 1st Meeting date into Due Date for the automation to work ? I might be able to negotiate that with my client.

Thanks in advance

Eric


author: Esme Crutchley
body: Hey [@eric_bouchet](/t5/user/viewprofilepage/user-id/3901025)

I think I might have found the rule:

![Screenshot 2020-05-13 at 12.52.35.png](https://community.atlassian.com/t5/image/serverpage/image-id/94667i3EE876236469D259/image-size/large?v=v2&px=999 "Screenshot 2020-05-13 at 12.52.35.png")![Screenshot 2020-05-13 at 12.52.44.png](https://community.atlassian.com/t5/image/serverpage/image-id/94668i077FD64D73F5E250/image-size/large?v=v2&px=999 "Screenshot 2020-05-13 at 12.52.44.png")![Screenshot 2020-05-13 at 12.52.50.png](https://community.atlassian.com/t5/image/serverpage/image-id/94669iC172512E81C74678/image-size/large?v=v2&px=999 "Screenshot 2020-05-13 at 12.52.50.png")![Screenshot 2020-05-13 at 12.53.17.png](https://community.atlassian.com/t5/image/serverpage/image-id/94670i1CC355500A85F74E/image-size/large?v=v2&px=999 "Screenshot 2020-05-13 at 12.53.17.png")

Does this look like it'll work?

Obviously you'd then need to add the actions of remove the green label and add the orange, but in theory, this should work. You could have another for 60 days to remove the orange and add the red.

Let me know if that looks like a win, if not, we'll try something else! We'll get this if it kills us (although not really!)!

Esme :)


author: eric_bouchet
body: Hello [@Esme Crutchley](/t5/user/viewprofilepage/user-id/3555478) ,

Yes, this is pretty much what I had done, but I suspect this does not run automatically.

![trello_custom.png](https://community.atlassian.com/t5/image/serverpage/image-id/94720iE56E486DF33298DA/image-size/large?v=v2&px=999 "trello_custom.png")

At least on my board it did not do anything, UNLESS I change date myself, which I understand IS the trigger to the rule. But since I want the label to change without any action from the user, this rule does not seem to work :(

We'll find a way :)

Thanks for trying with me

Eric


author: Esme Crutchley
body: Hi [@eric_bouchet](/t5/user/viewprofilepage/user-id/3901025)

Small question, butler rules only run on new information, so if you already have the dates set, it won't recognise it. Butler rules aren't retroactive.

If you go through every card and remove the dates and add them again, the butler rules should work. Butler won't act on dates that are already there, they have to be added after the rules are added if that makes sense.

If you go through all the cards and remove the dates and add them again, the rule should work on existing cards. All new cards that are added should work as they have been created after the Butler rule.


author: eric_bouchet
body: Hello [@Esme Crutchley](/t5/user/viewprofilepage/user-id/3555478) YES this is exactly my issue : I am looking for a way for these changes to happen *automatically*, and you confirm my fear : Butler rules only execute on a change. So this will not work with rules.

And I could not find a calendar automation that would look at custom fields :(

I understand one workaround would be to copy this date onto the Due Date, and then apply Butler Due Date logic to perform my label change, right ? I'd need to check with my client whether we can use the Due Date field for that matter.

Eric


author: Esme Crutchley
body: Hi [@eric_bouchet](/t5/user/viewprofilepage/user-id/3901025)

Ok, have you tried changing the date on a card and leaving it alone to see if the butler rule works?

I know that the butler rule has to be enabled on the board, then you have to add a date for it to work on, so I'm wondering if you enable the butler rule, change the date and then wait, if the rule will kick in.

The rule has to be enabled before you edit the date because if the date is already set, butler won't be able to act on it because it doesn't act retrospectively.

If it was me, I would enable all the rules, then select a few cards, remove the date from the custom field, close the card, open the card again, re-add the dates and wait to see what happens. Have you tried this?


author: eric_bouchet
body: Hello [@Esme Crutchley](/t5/user/viewprofilepage/user-id/3555478) ,

Yes indeed, this is what I had done before posting here. It does nothing. And indeed if I re-open the card, go to the custom field and save it again, the rule does run.

We'll find another way...

If possible with the client, I will work with Due Date and do the following:

* Butler rule : once "1st meeting" custom field is set, copy that date to Due Date and add Green label
* Butler due date : 30 days after a card with custom field "1st meeting" set is due, remove Green label, add Orange label
* Butler due date : 60 days after a card with custom field "1st meeting" set is due, remove Orange label, add Red label

I will need another level of check in the Due Date triggers, like for instance "custom field '1st meeting' is set and custom field '2nd meeting' is not set" so that it only triggers on selected cards. But in essence this should work.


author: Esme Crutchley
body: Hi [@eric_bouchet](/t5/user/viewprofilepage/user-id/3901025)

Sorry it's been a while!

Did you get that working? Is it behaving itself?


author: eric_bouchet
body: Hi [@Esme Crutchley](/t5/user/viewprofilepage/user-id/3555478) we put the topic on hold to focus on other needs. I believe my last proposal might work - provided we can use Trello's due date as a temp field. I will update here if/when this request comes back :)

Thanks for your help and guidance


author: Philip Nelson
body: Hello - I am running into the same problem.

Is there any way that we could do something like this:

1. Run a "find card" function based on the Custom Field date
2. Add \& remove labels
   1. Add a Green label on cards less than "X days"
   2. OR Remove Green label and add Yellow label on cards that falls between "X-XX days"
   3. OR Remove Yellow label and add Red label on cards are more than "XX days"

This would be a tremendous benefit for our clients!


Tags: butler

custom-field

date