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
- Upload logs or attach a report to a security scan and a bug opened from any system.
- 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-dataorx-www-form-urlencodedformat.
| Parameter | Description |
|---|---|
| comments | Comment 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" |
| attachments | A file blob with the first attachment. |
| attachments | Additional 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": []
}
| Parameter | Description |
|---|---|
| updatedEntitiesID | Array of updated entities, including system and entity IDs, and created attachment IDs. |
| errors | Errors that occurred during the attachment process. |
| warnings | Warnings that occurred during the attachment process. |
📝 Step-by-Step Instructions
-
Create a DevOps Gate Process.
-
Create entities in the target system that should be updated by the DevOps Gate.
-
Go to the DevOps Gate Process Configuration and add allowed projects (for demonstration purposes).
-
Press the "How It Works" link.
-
Select "Upload Attachments".
-
Copy the generated cURL command.
-
Paste the cURL command into your terminal, set the entity keys of the created entities, and execute.
-
Attachments will be uploaded to all entities mentioned in the comments or pull request.
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.