Working with Custom Fields

The following methods manage values of custom fields for a ticket, user, or group object.

Adding Values to a Custom Field in an Object

The addObjectCustomField method adds one or more values to a custom field in a specific object, such as a ticket, user, or group.

Note: If the maximum number of values for a field is exceeded, existing field values are deleted.

Request Type: addObjectCustomField

Element

Type

Description

sessionId Mandatory

String

Client’s session identifier.

objectType Mandatory

String

Type of object:

  • ticket
  • user
  • group
objectID Mandatory

Integer

ID of the ticket, user, or group.

customFields Mandatory

List of customField

One or more custom field objects. See CustomField Type (see CustomField Type ).

Response Type: addObjectCustomField

Element

Type

Description

result Mandatory

Integer

Method result. A value of 1 indicates success.

Possible failure values are:

  • Session not authenticated
  • Bad object ID
  • Bad custom field name
  • Action failed

Deleting All Values for a Custom Field in an Object

The deleteObjectCustomField method deletes all values of one or more custom fields for a specific object, such as a ticket, user, or group.

Request Type: deleteObjectCustomField

Element

Type

Description

sessionId Mandatory

String

Client’s session identifier.

objectType Mandatory

String

Type of object:

  • ticket
  • user
  • group
objectID Mandatory

Integer

ID of the ticket, user, or group.

customFields Mandatory

List of customField

One or more custom field objects. See CustomField Type (see CustomField Type ).

Response Type: deleteObjectCustomField

Element

Type

Description

result Mandatory

Integer

Method result. A value of 1 indicates success.

Possible failure values are:

  • Session not authenticated
  • Bad object ID
  • Bad custom field name
  • Action failed

Updating a Custom Field in an Object

The updateObjectCustomField method replaces the value of one or more custom fields for a specific object, such as a ticket, user, or group.

Request Type: updateObjectCustomField

Element

Type

Description

sessionId Mandatory

String

Client’s session identifier.

objectType Mandatory

String

Type of object:

  • ticket
  • user
  • group
objectID Mandatory

Integer

ID of the ticket, user, or group.

customFields Mandatory

List of customField

One or more custom field objects. See CustomField Type (see CustomField Type ).

Response Type: updateObjectCustomField

Element

Type

Description

result Mandatory

Integer

Method result. A value of 1 indicates success.

Possible failure values are:

  • Session not authenticated
  • Bad object ID
  • Bad custom field name
  • Action failed