HOW TO SET A COVER COLOR ON MY TRELLO CARD AUTOMATICALLY

Mattis PASSARD January 15, 2024

Hello,

I'm using the Trello Power-Up that allows creating a card with Gmail (new email = new card).

I want all the cards I create on this board to have the red color as their cover color.

I'm using the Trello MAPS on one of my Trello boards that lists all my cards of all my board (sync 6 Trello’s Board), the other cards are not created automatically but through a template with a color.

I haven't found a rule that would allow me to change the background color of a card when creating it.

Thanks You,

Mattis P.

1 answer

1 accepted

0 votes
Answer accepted
Dreamsuite Mike
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2024

Hi,

You can use Trello automation in combination with the Trello API.  Its slightly more advanced than a normal automation...

Ensure notifications are on because I will put this out as an article by the end of the week and I will share the link on here.

Mattis PASSARD January 16, 2024

Thanks You Mike for your answer,
I have never use the Trello API, I'm using simple Power-Up by Trello. I'll try but have you some steps ?

I have found on https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put :

"cover": { "color": "x",  

I dont know today how to set.values but it is the good way ?

Thanks you,

Mattis P.

Dreamsuite Mike
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 16, 2024

Hi @Mattis PASSARD 

Here is a reply to get you going, I will put this into an article soon...

Firstly, make sure you check out this video:

Here is an automation command that will match the card cover to the label colour...

when any label is added to a card, put to url "https://api.trello.com/1/cards/{cardidlong}?key=[enteryourapikeyhere]&token=[enteryourtokenhere]" with payload "{\"cover\": {\"color\": \"{labelcolor}\", \"size\": \"normal\"}}"

 

ezgif.com-video-to-gif (22).gif

Like # people like this
Marcelo _ MSocial Design e Mídias January 23, 2025

Hi @Dreamsuite Mike 

I'm new here, I managed to extract the API Keys and Tokens, but I didn't quite understand where I should apply this "automation command" code...

I looked for the article on your page and couldn't find it, could you help me?

Thank you!

PS. I've tried this, didn't work:
Captura de tela 2025-01-23 170554.png

Dreamsuite Mike
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 12, 2025

Hi @Marcelo _ MSocial Design e Mídias 

 

You have not used the correct automation action

 

Screenshot 2025-02-12 12.27.54.png

Marcelo _ MSocial Design e Mídias February 13, 2025

Thanks, I hadn't noticed! With this fix I was able to make it work! Well, almost...

I managed to make the automation work with the fixed color, which David Bakkers published here.

This one works normally for the fixed color:
URL - https://api.trello.com/1/cards/{cardid}
PAYLOAD - {"key" : "[your_rest_key_here]","token" : "[your_rest_token_here]","cover" : {"color" : "green","size" : "normal" }}

But I couldn't, in any way, not even by making some adjustments with the help of ChatGPT (lol), make the version with the color corresponding to the label color work.
I get the error "There was an error requesting the URL..." and "400 Error parsing body:"

This is the one that doesn't work for me:
URL - https://api.trello.com/1/cards/{cardidlong}?key=[enteryourapikeyhere]&token=[enteryourtokenhere]
PAYLOAD - {\"cover\": {\"color\": \"{labelcolor}\", \"size\": \"normal\"}}

I tried to do a hybrid between the two:
URL - https://api.trello.com/1/cards/{cardid}
PAYLOAD - {"key" : "[your_rest_key_here]","token" : "[your_rest_token_here]","cover" : {"color" : "{labelcolor}","size" : "normal" }}

But I got "400 {"message":"invalid cover color","error":"ERROR"}"
I tried labelcolor and \"{labelcolor}\" too, without success.

In short, for now, what I did was create several automations, one for each label/cover color. Which works for me, as long as it is for a small and defined amount of labels/colors.

Anyway, thanks for the help!

If you see anything that I might have done wrong, I'll try again with the version with the "labelcolor" variable.

Cheers!

Dreamsuite Mike
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2025

Hi @Marcelo _ MSocial Design e Mídias Only thing I can spot with the above is the fact that the labelcolor will only work with the base colors.  The card cover colors are:

green
yellow
orange
red
purple
blue
sky
lime
pink
black

Marcelo _ MSocial Design e Mídias February 13, 2025

Thanks, I'll try later with these colors.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events