How to Make a Trello Card using Webhooks
You can use the Datadog Webhook Integration to instantly create a Trello card using the @-notification
feature.
This flow uses the Trello REST POST card api endpoint to post the @notification to a relevant Trello list.
Steps to success
Getting the keys
To get the Trello App Key and Token, navigate to Trello’s relevant page. If you are logged in, you should be able to see the App key immediately:
NOTE: Trello mentions API key in the url. For this article, API and APP keys are one and the same
Authorize a token with the Trello Account you are currently logged into, the Green Arrow.
Designate the Trello list
In trello, click on a card in the list you’d like to add cards to and append .json
to the url and navigate to that url.
From there, find the value for idList.
Consult the API documentation for Trello cards and our webhook integration dedicated documentation page.
In the configuration:
Enable Custom Payload and fill in a json object that looks like:
{
"name": "$USER : $EVENT_TITLE",
"desc": "$EVENT_MSG",
"key": "{DATADOG_APPLICATION_KEY}",
"token": "{TOKEN_KEY}",
"pos": "bottom",
"idList": "{ID_LIST_VALUE}"
}
name
: corresponds to the title of the carddesc
: corresponds to the description of the cardkey
: corresponds to the application keytoken
: corresponds to the token keypos
: corresponds to the relative position of the card on the listidList
: corresponds to the list id
The resulting config should look like this and you are all set! @-notify away!
Some points to consider
This flow involves Trello generating a server token for our application. As you can see in the token disclaimer.
The token provides read/write access to all your boards and teams, so this is a potential concern if you do not want to give away access like that.
A good workaround would be to create a specific trello user that is only joined to the board you designate. Have that user receive the server token.