Skip to main content
Skip table of contents

REST API

Download an existing file

You must use this endpoint and make a GET:

CODE
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 permission to view the issue. Check the general documentation of JIRA API below if you are not familiar with that.


Upload a new file

You must make a POST:

CODE
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 the 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:

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

Example of body (single file) :

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

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

JSON
{
  "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 endpoint and make a GET:

CODE
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 endpoint and make a DELETE:

CODE
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://developer.atlassian.com/server/jira/platform/rest-apis/

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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.