Upload issue attachment
| Suitable Enviroment | SaaS |
| Private Deployment |
Requirements
| ONES | @ones-op/node-ability |
|---|---|
| v3.6.0+ | v0.6.1+ |
Overview
Using this ability, plugins can upload files as attachments to issue.
Performance
After the file is uploaded through the ability, a new file attachment is added to the issue:
Usage
Step 1: Installation dependency
Enter the /backend directory of the plugin project, and execute the following command for dependent installation:
npm i @ones-op/node-ability
Step 2: Upload Attachments
Call the uploadFile method to upload a file to an attachment of a issue
const file = await PluginFile.uploadFile('files/test.txt', 'taskuuid', 'desc', 'teamUUID')
-
Params
Param Type Description Required Default filePath string file address, the path under the workspacedirectoryY - referenceID string uuidof the issueY - desc string file description Y - teamUUID string uuidof the teamY - -
Return
The structure returned by the method contains information about the uploaded file.
Param Type Description hash string hashvalue of the fileurl string file download urlname string file name size int file size mime string file type version int file version