Skip to main content

Upload Attachments to Entities

Overview

This document outlines the process for uploading attachments to entities mentioned in a comment using SyncNow DevOps Gate APIs. This feature enables you to enrich work system entities with logs, reports, or other relevant files as part of your DevOps workflows.


💡 Example Scenarios

  1. Upload logs or attach a report to a security scan and a bug opened from any system.
  2. Attach a build report or artifact to an entity.

📨 API Request

The request URL should contain the system ID, which can be copied from the DevOps Process definition page.

POST /api/v1.0/DevOpsGate/Enrich/{DevOpsProjectID}/Attachment
  • The payload should be in form-data or x-www-form-urlencoded format.
ParameterDescription
commentsComment containing the entity IDs to update with #{Entity ID}. Example: "String with updated entity keys is ready for other DevOps Gate APIs, #CLS-3933, #CLS-3938"
attachmentsA file blob with the first attachment.
attachmentsAdditional attachments can be added with the same parameter name.

🟢 API Response

This is the response for the comment "String with updated entity keys is ready for other DevOps Gate APIs, #CLS-3933, #CLS-3938":

{
    "updatedEntitiesID": [
        {
            "systemID": "10",
            "entityKeys": [
                {
                    "entityKey": "CLS-3933",
                    "attachmentsID": [
                        "32013"
                    ]
                },
                {
                    "entityKey": "CLS-3938",
                    "attachmentsID": [
                        "32014"
                    ]
                }
            ]
        }
    ],
    "errors": [],
    "warnings": []
}
ParameterDescription
updatedEntitiesIDArray of updated entities, including system and entity IDs, and created attachment IDs.
errorsErrors that occurred during the attachment process.
warningsWarnings that occurred during the attachment process.

📝 Step-by-Step Instructions

  1. Create a DevOps Gate Process.

  2. Create entities in the target system that should be updated by the DevOps Gate.

    Create Entities

  3. Go to the DevOps Gate Process Configuration and add allowed projects (for demonstration purposes).

  4. Press the "How It Works" link.

    How It Works

  5. Select "Upload Attachments".

  6. Copy the generated cURL command.

    Copy cURL

  7. Paste the cURL command into your terminal, set the entity keys of the created entities, and execute.

    Paste Into Command Line

  8. Attachments will be uploaded to all entities mentioned in the comments or pull request.

    Entity From Commits


Tip:
Use this feature to automatically attach logs, reports, or artifacts to work system entities as part of your CI/CD or security workflows, improving traceability and collaboration.