Uploaded image for project: 'Xray for Jira Cloud'
  1. Xray for Jira Cloud
  2. XRAYCLOUD-11089

Backup REST API v2: attachment zip ignores modifiedSince and projectIds filters when withAttachment is true

    XporterXMLWordPrintable

Details

    • Bug
    • Status: Waiting Approval
    • Medium
    • Resolution: Unresolved
    • Xray Cloud 16.29.0
    • None
    • Backup
    • None
    • Xray Cloud, Jira Cloud, Backup REST API v2 (POST /api/v2/backup)

    • UNCOVERED

    Description

      Description

      When a backup is generated through the Backup REST API v2 with withAttachment set to true, the backup file respects the modifiedSince and projectIds filters but the attachment zip does not. The attachment zip always contains every Xray attachment in the instance (Test step attachments and Test Run evidences), regardless of the filters sent.

      Pre-conditions

      • At least two projects with Xray data and attachments (Project A and Project B)
      • In Project A, Tests A, B and D created with step attachments

      How to reproduce

      1. Note the current date and time as T1
      2. After T1, leave Test A untouched, edit a step of Test B without changing its attachment, create Test C with a step attachment and add a second attachment to Test D
      3. Generate a backup with POST /api/v2/backup using {"projectIds": ["<Project A id>"], "withAttachment": true} and download both files
      4. Generate another backup with {"projectIds": ["<Project A id>"], "modifiedSince": "<T1>", "withAttachment": true} and download both files
      5. Compare the backup files and the attachment zips of both runs

      Actual result/Attachments

      The backup files are filtered correctly. The first one has all Tests of Project A and the second one only has Tests B, C and D.
      The attachment zips are identical in both runs (same files, same CRCs, same metadata_0.json). The second zip still includes the attachment of Test A, which wasn't modified after T1, and both zips include attachments of Tests and Test Runs from Project B.

      Expected result

      The attachment zip only includes attachments of the entities included in the backup file, following the same modifiedSince and projectIds filters.

      Version

      • Xray Cloud 16.29.0

      Workaround

      None known. The metadata_0.json in the attachment zip can be used to keep only the attachments related to the entities in the backup, but the full attachment set still has to be generated and downloaded first, which isn't feasible on instances with a large volume of attachments.

      Attachments

        Issue Links

          Activity

            People

              bernardo.cottim Bernardo Cottim
              joao.silva João Silva
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: