-
-
Notifications
You must be signed in to change notification settings - Fork 5
UpdateCardAsync
Rasmus Wulff Jensen edited this page Jun 7, 2023
·
8 revisions
Update a Card
/// <summary>
/// Update a Card
/// </summary>
/// <param name="cardWithChanges">The card with the changes</param>
/// <param name="cancellationToken">Cancellation Token</param>
/// <returns>The Updated Card</returns>
public async Task<Card> UpdateCardAsync(Card cardWithChanges, CancellationToken cancellationToken = default) {...}var cardId = "63c939a5cea0cb006dc9e9dd";
var cardToUpdate = await _trelloClient.GetCardAsync(cardId); //Get the card you wish to update
//Update various aspects of a card
cardToUpdate.Start = DateTimeOffset.Now;
cardToUpdate.Cover = null; //Set to Null to remove cover
cardToUpdate.LabelIds.Add("My extra Label Id"); //Add One more label (Use 'TrelloClient.GetLabelsOfBoardAsync()' to find real ids)
var updatedCard = await _trelloClient.UpdateCardAsync(cardToUpdate);
//*********************************************************************
//Move the card to another List and/or Position
var cardToMove = await _trelloClient.GetCardAsync(cardId); //Get the card you wish to update
cardToMove.ListId = "IdOfTheListToMoveTo";
cardToMove.Position = 1; //Low number to move to the top, high number to move to the bottom
await _trelloClient.UpdateCardAsync(cardToMove);AddCardAsyncGetCardAsyncGetCardsOnBoardAsyncGetCardsOnBoardFilteredAsyncGetCardsInListAsyncGetCardsForMemberAsyncArchiveCardAsyncReOpenCardAsyncArchiveAllCardsInListAsyncMoveAllCardsInListAsyncMoveCardToListAsyncDeleteCardAsyncSetDueDateOnCardAsyncSetStartDateOnCardAsyncSetStartDateAndDueDateOnCardAsync
If you are looking for info on a specific method in TrelloDotNet then expand the Pages above and input the 'MethodName' (Example: 'AddCardAsync')