in src/YouTrackSharp/Issues/IssuesService.Comments.cs [65:97]
public async Task DeleteCommentForIssue(string issueId, string commentId, bool permanent = false)
{
if (string.IsNullOrEmpty(issueId))
{
throw new ArgumentNullException(nameof(issueId));
}
if (string.IsNullOrEmpty(commentId))
{
throw new ArgumentNullException(nameof(commentId));
}
var client = await _connection.GetAuthenticatedApiClient();
if (permanent)
{
try
{
await client.IssuesCommentsDeleteAsync(issueId, commentId);
}
catch (YouTrackErrorException e)
{
if (e.StatusCode == (int)HttpStatusCode.NotFound)
{
return;
}
throw;
}
}
else
{
await client.IssuesCommentsPostAsync(issueId, commentId, false, "id", new IssueComment() {Deleted = true});
}
}