Deletes an issue. This example deletes the issue having key = "SCRUM-13". A successful delete is indicated by a response status code equal to 204 with an empty response body. This example demonstrates one possible JSON error response (where the response status code was 403).
curl -X DELETE --user jira@example.com:JIRA_API_TOKEN \
--header 'Accept: application/json' \
--url 'https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-13'
import sys
import chilkat
rest = chilkat.CkRest()
# URL: https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-13
bTls = True
port = 443
bAutoReconnect = True
success = rest.Connect("your-domain.atlassian.net",port,bTls,bAutoReconnect)
if (success != True):
print("ConnectFailReason: " + str(rest.get_ConnectFailReason()))
print(rest.lastErrorText())
sys.exit()
rest.SetAuthBasic("jira@example.com","JIRA_API_TOKEN")
rest.AddHeader("Accept","application/json")
sbResponseBody = chilkat.CkStringBuilder()
success = rest.FullRequestNoBodySb("DELETE","/rest/api/2/issue/SCRUM-13",sbResponseBody)
if (success != True):
print(rest.lastErrorText())
sys.exit()
respStatusCode = rest.get_ResponseStatusCode()
if (respStatusCode >= 400):
print("Response Status Code = " + str(respStatusCode))
print("Response Header:")
print(rest.responseHeader())
print("Response Body:")
print(sbResponseBody.getAsString())
sys.exit()
jsonResponse = chilkat.CkJsonObject()
jsonResponse.LoadSb(sbResponseBody)
i = 0
count_i = jsonResponse.SizeOfArray("errorMessages")
while i < count_i :
jsonResponse.put_I(i)
strVal = jsonResponse.stringOf("errorMessages[i]")
i = i + 1
{
"errorMessages": [
"You do not have permission to delete issues in this project."
],
"errors": {}
}