Project Team for Jira Data Center
Breadcrumbs

Updating or clearing the value of a specific custom field for a user

On this page

Use this method to update or clear the value of a user custom field for a specific Jira user.

You must be authenticated with a user who has permissions to edit the custom fields of other users. See Configuring the app permissions.

Request URL

The request URL takes the following form:

PUT <ROOT>/rest/stonikbyte-project-team-api/1.0/custom-field-value/{userKey}/{fieldId}

Parameters

Parameter

Description

{userKey}

The key of the Jira user for which you want to update the field.

{fieldId}

The id of the user custom field that you want to update.

An example of the request URL with parameters is as follows: http:/ /MY_Jira_BASE_URL/rest/stonikbyte-project-team-api/1.0/custom-field-value/dorothy.grey/4 In this example the custom field with ID 4 of the user dorothy.grey will be updated.

Also, the body of the request must contain a JSON with the following data.

Attribute

Description

value

The value that you want to set for the custom field. For custom fields of type Single Line Text, Multi Line Text and User Picker, the value must be in string format. For custom fields of type Multi Value Picker, the value must be in array format containing the IDs of the field value entries. See the examples below.

Example 1: A JSON body to be used for setting the value of a custom field of type Single Line Text.

JSON
{
  "value": "This is the single line text value "
}

Example 2: A JSON body to be used for setting the value of a custom field of type Multi Line Text. Use "\n" to add a new line.

JSON
{
  "value": "This is the first line.\nThis is the second line."
}

Example 3: A JSON body to be used for setting the value of a custom field of type User Picker. The value must match a user key.

JSON
{
  "value": "john.smith"
}

Example 4: A JSON body to be used for setting the value of a custom field of type Multi Value Picker. The array must contain the IDs of the value entries of the Multi Value Picker field.

JSON
{
  "value": [2,3]
}

Example 5: A JSON body to be used for clearing the value of a custom field of type Single Line Text, Multi Line Text or User Picker.

JSON
{
  "value": ""
}

Example 6: A JSON body to be used for clearing the value of a custom field of type Multi Value Picker.

JSON
{
  "value": []
}

A successful response

An HTTP 200 status response indicates a successful request.

Error Response

If the REST call fails, the service returns one of the following HTTP statuses:

HTTP Status Code

Description

401

Returned if the calling user is not authenticated or user does not have enough permissions. Same in case of invalid app license.

400

Returned if the provided parameters or the JSON body are invalid.