We are performing a phasewise scheduled maintenance of our Zephyr for Jira Cloud and Capure for Jira Cloud instances to be compliant with GDPR- Atlassian privacy policy (https://www.atlassian.com/trust/privacy) .Please expect a downtime during this phase of maintenance from Saturday, 01/12/2019, 9:30 PM PST up until Sunday 01/13/2019, 9:30 AM PST.This will be for our phasewise deployment of infrastructure changes, migration utility verification and customer data migration, as part of our GDPR and Atlassian privacy policy compliance efforts.For any further queries regarding this please rasie a ticket by using the option 'Submit a Ticket' below
Support | Zephyr



Delete an attachment from a step result using ZAPI (Rest API)

Created on

Problem

How to delete an attachment from a step result

Resolution/Fix:

Steps

1)You need to first retrieve the attachment Id by using stepresultid

Please find the sample request below.

http://JIRA_SERVER/rest/zapi/latest/attachment/attachmentsByEntity?entityId=8&entityType=TESTSTEPRESULT

2)Next you need to pass this attachment Id value in your Rest API request call.

Please check the sample code snippet below

attachmentId = "89"

values = dumps({
"id": attachmentId
})

request = Request(baseURL + "/rest/zapi/latest/attachment/" + attachmentId, data=values, headers=headers)
request.get_method = lambda: 'DELETE'
response_body = urlopen(request).read()


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Powered by Zendesk