-
-
Notifications
You must be signed in to change notification settings - Fork 5
Custom Automation Conditions
Rasmus Wulff Jensen edited this page Aug 22, 2026
·
6 revisions
The Automation Engine has various out-of-the box Conditions, but there can be cases where you wish to make your own custom condition
If you think the Condition you need so be an out-of-the-box Condition feel free to open an issue or create a Pull Request with your custom Condition
- Make a new C# class and Call it 'MyCustomCondition' (or what you like it to be called but it is recommended to suffix it 'Condition')
- Let the class implement interface
IAutomationCondition - Let the class implement the mandatory member
IsConditionMetAsync
//Your custom Condition
public class MyCustomCondition: IAutomationCondition
{
public async Task<bool> IsConditionMetAsync(WebhookAction webhookAction)
{
//Your Logic if the Condition is met
WebhookActionData webhookActionData = webhookAction.Data; //This object has data about the event
TrelloClient trelloClient = webhookAction.TrelloClient; //If you need the TrelloClient to access data from Trello to evaluate your event you have access to it here
return false; //Return true if the Condition is met (aka continue to Actions) or False if not met (stop processing)
}
}Inside the IsConditionMetAsync you have access to the WebhookAction (aka the JSON given by the Webhook) + The TrelloClient for further data lookups if needed
To better get a sense of how Conditions look are here links to the various real-time implementations for inspiration:
- Source Code: CardCoverCondition
- Source Code: CardFieldCondition
- Source Code: ChecklistItemsCompleteCondition
- Source Code: ChecklistItemsIncompleteCondition
- Source Code: ChecklistIncompleteCondition
- Source Code: ChecklistNotStartedCondition
- Source Code: LabelCondition
- Source Code: ListCondition
- Source Code: MemberCondition
If you are looking for info on a specific method in TrelloDotNet then expand the Pages above and input the 'MethodName' (Example: 'AddCardAsync')