How to set a cover color on my card using Trello automation in combination with the API?

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

I use the card cover to make it easier to identify and categorize requests within the board.

I found this post here on the forum, trying exactly the same thing as me, and @Dreamsuite Mike posted a solution.

HOW TO SET A COVER COLOR ON MY TRELLO CARD AUTOMATICALLY 

But even following his step by step, several times, I couldn't get it to work...  I managed to extract the API Keys and Tokens, but thats all.

Captura de tela 2025-01-23 170554.png

Has anyone managed to replicate it? Was there a problem that you managed to get around? Thank you very much!

 

 

1 answer

0 votes
David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 12, 2025

Hello @Marcelo _ MSocial Design e Mídias 

If you search this forum for the topic 'automation cover color' you'll find this thread from waaayyy back in 2021, where I described step-by-step exactly how to set the cover color via the REST API using Trello automation.

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

Thank you! I'll try as soon as I can... 

David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 12, 2025

Also, don't put actual square brackets around the key or token:

Payload.png

Those are used in the documentation as symbols to denote demarcation and are not supposed to be put in the automation text itself.

 

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

It worked! Well, almost...

I managed to make the automation work with the fixed color, the one in the old thread you posted...

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" : "full" }}

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:
URL - https://api.trello.com/1/cards/{cardid}?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" : "full" }}

But I got "400 {"message":"invalid cover color","error":"ERROR"}"

In short, for now, what I did was create several automations, one for each label/cover color.

Thanks for your help! If I see anything I might have done wrong, I'll try again with the version with the "{labelcolor}" variable.

Cheers!

David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2025

The cover color can only be set to 10 different colors, whereas labels can be set to 30 different colors:

Cover Color. Can be 'green', 'yellow', 'orange', 'red', 'purple', 'blue', 'sky', 'lime', 'pink' or 'black’.

Label Color. Can be 'green', 'yellow', 'orange', 'red', 'purple', 'blue', 'sky', 'lime', 'pink' or 'black', each of which can be suffixed with '_light' or '_dark' (ie. 'green', 'green_light' or 'green_dark' for a total of 30 possible colors)

... so the 20 light or dark label colors cannot be used for the cover color.

Also, I assume you are aware that {labelcolor} will only contain a value if the rule trigger was a new label being added to the card; otherwise, the smart value has no idea which specific label on the card you are referring to.

Lastly, it seems you're duplicating all these questions in another thread, so I'll stop adding to this thread.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events