Overview
Attach File Manager Kepler - Attachment fields | simple & multiple For Jira provides a REST API to enable that enables you to retrieve an image and attach a document from an URL outside of apart from the Jira context.
Attach File :
You will need to perform an HTTP Post on the following URL :
Bloc de code |
---|
<Base-URL>/rest/kepler/1.0/file-attach/base64 |
Body :
Bloc de code |
---|
{
"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:
Bloc de code |
---|
<Base <Base-URL>/rest/kepler/1.0/file-attach/download/Base64(${customfield_Value})/${customfield_id}/${issue_id}?forceUTF8=${forceUTF8} |
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 |
issue_id | int parameter : The identifier of the issue in question. |
forceUTF8 | Boolean parameter not required with default value is false. If enable, you will ignore encoding mention in config page and use UTF-8 as default |
An example of usage :
Bloc de code |
---|
http://192.168.1.42:8410/rest/kepler/1.0/file-attach/download/aW1hZ2UwMDItMTU3OTUwNDI3NjA4OGN1c3RvbWZpZWxkXzExMDAxLnBuZw==/customfield_11001/10100 |
Bloc de code |
---|
http://192.168.1.42:8410/rest/kepler/1.0/file-attach/download/aW1hZ2UwMDItMTU3OTUwNDI3NjA4OGN1c3RvbWZpZWxkXzExMDAxLnBuZw==/customfield_11001/10100?forceUTF8=true |
Delete file:
Info |
---|
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:
Bloc de code |
---|
<Base-URL>/rest/kepler/1.0/file-attach/delete?filenameEncoded={1}&customfieldId={2}&issueKey={3} |
Where :
{1}: The encoded filename as base64, to delete, will be useful only on multiple types.
{2}: The id of the custom field that you want to delete. Example: customfield_10000.
{3}: The key of the issue for the deletion context.
Usage example :
Bloc de code |
---|
curl --location --request DELETE 'localhost:2990/jira/rest/kepler/1.0/file-attach/delete?filenameEncoded=aW1hZ2UwMDItMTU3OTUwNDI3NjA4OGN1c3RvbWZpZWxkXzExMDAxLnBuZw==&customfieldId=customfield_10000&issueKey=DEV-1' |