VB.NET Jira - Issues: Delete a Comment

Back to Index

Deletes a comment. This example deletes comment (id=10019) for the issue with key = "SCRUM-15". A successful response is indicated by a 204 response code with no response body.

Documentation: https://developers.atlassian.com/cloud/jira/platform/rest/#api-api-2-issue-issueIdOrKey-comment-id-delete

CURL Command

curl --request DELETE --user jira@example.com:JIRA_API_TOKEN \
  --header 'Accept: application/json' \
  --url 'https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15/comment/10019'

VB.NET Example

Dim rest As New Chilkat.Rest
Dim success As Boolean

'  URL: https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15/comment/10019
Dim bTls As Boolean = True
Dim port As Integer = 443
Dim bAutoReconnect As Boolean = True
success = rest.Connect("your-domain.atlassian.net",port,bTls,bAutoReconnect)
If (success <> True) Then
    Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
    Debug.WriteLine(rest.LastErrorText)
    Exit Sub
End If


rest.SetAuthBasic("jira@example.com","JIRA_API_TOKEN")

rest.AddHeader("Accept","application/json")

Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestNoBodySb("DELETE","/rest/api/2/issue/SCRUM-15/comment/10019",sbResponseBody)
If (success <> True) Then
    Debug.WriteLine(rest.LastErrorText)
    Exit Sub
End If

Dim respStatusCode As Integer = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
    Debug.WriteLine("Response Status Code = " & respStatusCode)
    Debug.WriteLine("Response Header:")
    Debug.WriteLine(rest.ResponseHeader)
    Debug.WriteLine("Response Body:")
    Debug.WriteLine(sbResponseBody.GetAsString())
    Exit Sub
End If