-
Notifications
You must be signed in to change notification settings - Fork 4
ClearCustomFieldValueOnCardAsync
Rasmus Wulff Jensen edited this page Nov 1, 2023
·
5 revisions
Clear a Custom field on a Card
/// <summary>
/// Clear a Custom field on a Card
/// </summary>
/// <param name="cardId">Id of the Card</param>
/// <param name="customField">The custom Field to clear</param>
/// <param name="cancellationToken">Cancellation Token</param>
public async Task ClearCustomFieldValueOnCardAsync(string cardId, CustomField customField, CancellationToken cancellationToken = default) {...}
var boardId = "641ddde2e37dc99ab1ccc988";
List<CustomField> customFieldsOnBoardAsync = await _trelloClient.GetCustomFieldsOnBoardAsync(boardId);
var card = (await _trelloClient.GetCardsOnBoardAsync(boardId)).First(); //Grab random card
//Clear the Card of Custom Values
foreach (var customField in customFieldsOnBoardAsync)
{
await _trelloClient.ClearCustomFieldValueOnCardAsync(card.Id, customField);
}
If you are looking for info on a specific method in TrelloDotNet then expand the Pages above and input the 'MethodName' (Example: 'AddCardAsync')