API

Protected Fields can be read/edited via API.

Go to Manage Apps → Protected Fields

Click the API tab.

To enable API access you need to generate an access token.

Click the Generate Access Token - button to generate one or more tokens.

By default the access token will be applicable for all projects with Read and Write permissions.

Click the Edit link to edit token permissions

Get Protected Field values via API

Make a HTTP GET request to the URL available on your API page.

Required parameters:

token = the access token (scope must be READ and projects must match issue project)

issueKey = the issue to read protected field values from

fieldId = id of field to read value from

Note: add multiple fieldId parameters to receive multiple fields in one request.

Response:

200 OK (application/json) When request is valid

Body:

[ { "fieldId":"customfield_10121", "value": value in readable format }, { "fieldId":"customfield_10122", "value": value in readable format } ]

400 BAD REQUEST When request is invald

Body:

Error message

Note: Verify parameters to resolve this issue

401 UNAUTHORIZED When request is unauthorized.

Body:

Error message

Note: Verify access token permissions to resolve this issue

Store Protected Field values via API

Make a HTTP PUT (or POST) request to the URL available on your API page.

Required parameters:

token = the access token (scope must be WRITE and projects must match issue project)

issueKey = the issue to read protected field values from

Required post body:

An array of field entities, use multiple entities to update multiple field values. Note: To update a single value this still has to be an array containing the single value entity.

[ { "fieldId":"customfield_10121", "value" Object value in readable format (string, number, date on format "yyyy-MM-dd") }, { "fieldId":"customfield_10122", "value" Object value in readable format } ]

Response:

200 OK When request is valid and value was updated

Body: OK

400 BAD REQUEST When request is invalid

Body:Bad Request

Note: Verify parameters to resolve this issue

401 UNAUTHORIZED When request is unauthorized.

Body: Unauthorized

401 BAD REQUEST When request is unauthorized.

Body:Bad Request

Field Formats

Users

Encrypted User Field

{ "fieldId": "customfield_10122", "value": "{{accountId}}" }

Unencrypted User Field

Multi-User picker

Encrypted Multi User Field

Unencrypted Multi User Field

Group field

Encrypted Group Field

Unencrypted Group Field

Collection Field

Encrypted Collection Field

Unencrypted Collection Field

Number Field

Encrypted Number Field

Unencrypted Number Field

Text Field

Encrypted Text Field

Unencrypted Text Field