Search code examples
c#trello.net

Trello.Net: how to access Action list?


I am using C# and Trello.Net package to extract Trello information. Trello.Net is great in getting almost everything that I need. However, I do run into a simple challenge and need help. How can I get the list of activity (action list) from a Card? I assume I can get the list from the Card so if it is not, please correct me.

Here is my snippet of code:

var results = trello.Search(_card.Name); //search the card by name    
var actionList = results.Actions;

I also try with the full set of Search parameters

var modelList = new List<ModelType> { ModelType.Actions };
var results = trello.Search(_card.Name, 100, null, modelList, null, false);
var actionList = results.Actions;

But the actionList is always empty.

Can someone please point me to the right direction in getting the list of actions?

Thanks,

Chi


Solution

  • You can get all actions for a card this way:

    var card = trello.Cards.WithId(cardId);
    var actions = trello.Actions.ForCard(card);