dillenmeister/Trello.NET

UpdateCheckItemStateOnCardAction not captured in trello.Actions.ForCard

Closed this issue · 4 comments

I noticed when i call for a card's actions that some of the actions are not present. Specifically the UpdateCheckItemStateOnCardAction is missing.

trello.Actions.ForCard(new Card(){Id="51bb62f0027d886426005f19"}).Dump();

link to method output:
http://bit.ly/17F4O4p

link to json data:
http://bit.ly/14clVWD

Can you provide some code that reproduces this bug? I can't use the card id you provided since I don't have permissions...

I provided the json data for the card. Would it be possible to create a object from that?

ITrello trello;

void Main()
{
    trello = new Trello(TrelloIds.AppKey);
    trello.Authorize(TrelloIds.UserToken);

    var card = CreateCard(trello);
    card = UpdateCard(trello, card);
    trello.Actions.ForCard(card).Dump();
    return;

}
Card UpdateCard(ITrello trello, Card card)
{
    card = trello.Cards.WithId(card.Id);
    var chkLst = card.Checklists.First();
    var chkItem = chkLst.CheckItems.First ();
    var task = trello.Async.Cards.ChangeCheckItemState(card, chkLst, chkItem, true);

    Task.WaitAll(new Task[]{task});
    return card;

}
Card CreateCard(ITrello trello)
{

    var board = new BoardId(TrelloIds.BoardId);
    //Add list to board
    var lst = trello.Lists.Add("List" + DateTime.Now.Ticks,new BoardId(TrelloIds.BoardId));

    //create new card

    var card = trello.Cards.Add(new NewCard("Card", new ListId(lst.Id)));
    trello.Cards.Update(card);

    // Create a checklist
    var chkLst = trello.Checklists.Add("Check List", board);

    // Add the checklist to a card
    trello.Cards.AddChecklist(card, chkLst);

    // Add check items
    trello.Checklists.AddCheckItem(chkLst, "My check item");
    trello.Cards.Update(card);

    return card;
}

class TrelloIds
{
      public const string AppKey = "";
      public const string UserToken = "";
      public const string BoardId = "";

}

@johnbabb This should do it, but it would be great if you could try it out!