Skip to content
Rasmus Wulff Jensen edited this page May 29, 2023 · 8 revisions

Back to Card Features

Update a Card

Signature

/// <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) {...}

Examples

var cardId = "63c939a5cea0cb006dc9e9dd"; //Closed/Archived Card Id
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);

See Also

Clone this wiki locally