Overview
Attach File Manager For Jira provides a REST API that enables you to retrieve and attach a document from an URL apart of the Jira context.
Attach File :
You will need to perform an HTTP Post on the following URL :
<Base-URL>/rest/kepler/1.0/file-attach/base64
Body :
{ "attachedFiles":[ { "filename":filename1, "customfieldId":customfield_id, "issueKey":issueKey, "content":fileAsBase64 }, ...... ] }
Retreive file:
Base URL
The base URL to call the file Attach File Manager For Jira is:
<Base-URL>/rest/kepler/1.0/file-attach/download/Base64(${customfield_Value})/${customfield_id}
Required Parameters
Parameters | Explanation |
---|---|
customfield_Value | the value of the custom field |
base64(customfield_Value) | The encoded value of the custom field |
customfield_id | The String id of the custom field example: customfield_10000 |
An example of usage :
http://192.168.1.42:8410/rest/kepler/1.0/file-attach/download/aW1hZ2UwMDItMTU3OTUwNDI3NjA4OGN1c3RvbWZpZWxkXzExMDAxLnBuZw==/customfield_11001
Delete file:
The deletion can be also tuned on the field configuration as you can choose to delete or archive the file Configuration of Kepler - Attachment fields | simple & multiple
Base URL
The base URL for deletion is as follows:
<Base-URL>/rest/kepler/1.0/file-attach/delete?customfield={1}&issueKey={2}&filename={3}
Where :
{1}: The id of the custom field That you want to update
{2}: The key of the issue for the deletion context
{3}: The filename, to delete, will be useful only on multiple types.
Usage example :
curl --location --request DELETE 'localhost:2990/jira/rest/kepler/1.0/file-attach/delete?filename=search%20box-1644144093610customfield_10000_admin.jpg&customfieldId=customfield_10000&issueKey=DEV-1'