REST API

Download an existing file

You must use this enpdoint and make a GET:

GET {server:port}/{your-jira-context}/rest/apwide/document/1.0/file/{issueId}/{fieldId}/{fileId}
  • issueId: numerical id of the issue (ex: 10234)

  • fieldId: key of the apwide custom field (ex: customfield_10345)

  • fileId (since version 3.1.+): id of the file to download (ex: 1544184648025_10000_file-field-1.0.5.jar.zip)

N.B. you must be authenticated and your user must have permissions to view the issue. Check general documentation of JIRA API below if you are not familiar with that.

Upload a new file

You must make a POST:

POST {server:port}/{your-jira-context}/rest/apwide/document/1.0/file?fileName=YourFileName.example
  • Body: content of your file (text or binary)

  • fileName: the desired file name that will be displayed in JIRA

It will then return you the fileId. The fileId is the unique key of the document. It is also the value that is stored in JIRA as custom field value. You must keep this fileId to update your issues in the next step.

Update your File Field Customfield with previously uploaded file(s)

You must make a PUT:

PUT {server:port}/{your-jira-context}/rest/api/2/issue/{issueIdOrKey}

Example of body (single file) :

{
"fields" : {
"customfield_10602": "your generated file id"
}
}

Example of body (multiple files, since version 3.1.+) :

{
"fields" : {
"customfield_10602": "generated_file_id_1,generated_file_id_2,generated_file_id_3"
}
}

Download an existing file by its unique ID

You must use this enpdoint and make a GET:

GET {server:port}/{your-jira-context}/rest/apwide/document/1.0/file/{documentId}
  • documentId: unique id of the file stored in the customfield (ex: 1544184648025_10000_file-field-1.0.5.jar.zip)

N.B. You must be authenticated and your user must have Jira administration permissions. Check general documentation of JIRA API below if you are not familiar with that.

Remove an existing file by its unique ID

You must use this enpdoint and make a DELETE:

DELETE {server:port}/{your-jira-context}/rest/apwide/document/1.0/file/{documentId}
  • documentId: unique id of the file stored in the customfield (ex: 1544184648025_10000_file-field-1.0.5.jar.zip)

N.B. You must be authenticated and your user must have Jira administration permissions. Check general documentation of JIRA API below if you are not familiar with that.

Jira Documentation & Tools

General documentation of JIRA API: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/

Check also this free add-on that is very convenient to browse the REST API of JIRA: https://marketplace.atlassian.com/plugins/com.atlassian.labs.rest-api-browser/server/overview

Note that you have to disable "Show only public API's" in order to see API's of third party plugins like Apwide File Fields.

Screenshots above were done with the REST API Browser plugin.