public void AttachToCard(string boardName, string listName, string cardName, string fileToAttach) { if (!File.Exists(fileToAttach)) throw new FileNotFoundException("File not found", fileToAttach); var listid = new ListId(trello.Lists.ForBoard(trello.Boards.ForMe().First(b => b.Name == boardName)) .First(l => l.Name == listName).GetListId()); var card = trello.Cards.ForList(listid) .First(c => c.Name == cardName).GetCardId(); var cardid = new CardId(card); trello.Cards.AddAttachment(cardid, new FileAttachment(fileToAttach)); }
public void AddCard(string boardName, string listName, string cardName, string commentText = "") { if(string.IsNullOrWhiteSpace(commentText)) throw new Exception("Cannot add empty comment"); var listid = new ListId(trello.Lists.ForBoard(trello.Boards.ForMe().First(b => b.Name == boardName)) .First(l => l.Name == listName).GetListId()); var card = trello.Cards.Add(cardName, listid); var cardid = new CardId(card.GetCardId()); trello.Cards.AddComment(cardid, commentText); }