-
-
Notifications
You must be signed in to change notification settings - Fork 5
DeleteLabelAsync
Rasmus Wulff Jensen edited this page Nov 1, 2023
·
4 revisions
Delete a Label from the board and remove it from all cards it was added to (WARNING: THERE IS NO WAY GOING BACK!!!).
If you are looking to remove a label from a Card then see
RemoveLabelsFromCardAsyncandRemoveAllLabelsFromCardAsync
/// <summary>
/// Delete a Label from the board and remove it from all cards it was added to (WARNING: THERE IS NO WAY GOING BACK!!!). If you are looking to remove a label from a Card then see 'RemoveLabelsFromCardAsync' and 'RemoveAllLabelsFromCardAsync'
/// </summary>
/// <param name="labelId">The id of the Label to Delete</param>
/// <param name="cancellationToken">Cancellation Token</param>
public async Task DeleteLabelAsync(string labelId, CancellationToken cancellationToken = default) {...}var boardId = "63c939a5cea0cb006dc9e88b";
List<Label> labelsOnBoard = await _trelloClient.GetLabelsOfBoardAsync(boardId);
//Get the 'bug' label and delete it
Label labelBug = labelsOnBoard.First(x => x.Name == "Bug");
await _trelloClient.DeleteLabelAsync(labelBug.Id);If you are looking for info on a specific method in TrelloDotNet then expand the Pages above and input the 'MethodName' (Example: 'AddCardAsync')