Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Done
-
4.0.0
-
None
-
XRAY 2020 Sprint 2, XRAY 2020 Sprint 3
-
Description
When using the Jira REST API to update a Manual Test, attachments are duplicated.
Since Xray 4.0.0+, when we use the Jira REST API and the Manual Test Step Custom Field is used with an attachment, these attachments are NOT updated (as expected) but instead duplicated.
This is problematic if a user gets all the CFS from the GET Jira endpoint and them used the PUT endpoint with the same fields: In this case, each request will duplicate the attachments of each Test Step.
Steps to reproduce:
- Create a Manual Test with a single Test Step with 1 attachment.
- Update the Issue's Test Step Custom Field via Jira REST API with the attachment included
- The attachment is not updated, as expected, but instead all the attachments mentioned in the REST requests are added to the Test Step.
Jira update REST API request:
PUT <SERVER>/rest/api/2/issue/<ISSUE KEY> { "fields": { "customfield_10104": { "steps": [{"id": 6249, "index": 1, "fields": {"action": "potato"}, "attachments": [{ "id": 1571, "fileName": "Screenshot 2020-07-27 at 10.36.53.png", "fileIcon": "image.gif", "mimeType": "image/png", "fileIconAlt": "PNG File", "fileSize": "647 kB", "numericalFileSize": 662564, "created": "2020-07-27T10:45:49+01:00", "createdDate": 1595843149722, "author": "admin", "authorFullName": "Bruce Wayne", "fileURL": "http://localhost:30000/plugins/servlet/raven/attachment/1571/Screenshot+2020-07-27+at+10.36.53.png", "filePath": "/Users/xpand/Documents/jira_home/data/attachments/CALC/10000/CALC-2251/xray_1571" }]}] } } }