Custom Choice Fields
For User custom choice:
GET /v3/trackers/{trackerId}/fields/1001:
{
"id": 1001,
"name": "User custom choice",
"type": "OptionChoiceField",
"hidden": false,
"valueModel": "ChoiceFieldValue<ChoiceOptionReference>",
"mandatoryInStatuses": [],
"multipleValues": false,
"options": [
{
"id": 0,
"name": "Unset",
"type": "ChoiceOptionReference"
},
{
"id": 1,
"name": "First option",
"type": "ChoiceOptionReference"
},
{
"id": 2,
"name": "Second option",
"type": "ChoiceOptionReference"
},
{
"id": 3,
"name": "Third option",
"type": "ChoiceOptionReference"
}
],
"referenceType": "ChoiceOptionReference"
}
The valueModel is a ChoiceFieldValue<ChoiceOptionReference> which means that we will need a ChoiceFieldValue which contains ChoiceOptionReference as values.
The field definition defines the available options also:
"options": [
{
"id": 0,
"name": "Unset",
"type": "ChoiceOptionReference"
},
{
"id": 1,
"name": "First option",
"type": "ChoiceOptionReference"
},
{
"id": 2,
"name": "Second option",
"type": "ChoiceOptionReference"
},
{
"id": 3,
"name": "Third option",
"type": "ChoiceOptionReference"
}
]
Now we have all information to construct our customFields item:
"customFields": [
{
"fieldId": 1001,
"name": "User custom choice",
"values": [
{
"id": 2,
"name": "Second option",
"type": "ChoiceOptionReference"
}
],
"type": "ChoiceFieldValue"
}
]
Was this helpful?