If I make a request to ‘/api/v2/ticket_fields
’ I receive a JSON response with the following ‘source’ field entry:
[
{
"id": 000000000,
"name": "source",
"label": "Source",
"description": "Ticket source",
"position": 4,
"required_for_closure": false,
"required_for_agents": false,
"type": "default_source",
"default": true,
"customers_can_edit": false,
"label_for_customers": "Source",
"required_for_customers": false,
"displayed_to_customers": false,
"created_at": "2017-12-21T00:00:00Z",
"updated_at": "2020-01-27T00:00:00Z",
"choices": {
"Email": 1,
"Portal": 2,
"Phone": 3,
"Forum": 4,
"Twitter": 5,
"Facebook": 6,
"Chat": 7,
"MobiHelp": 8,
"Feedback Widget": 9,
"Outbound Email": 10,
"Ecommerce": 11,
"Bot": 12,
"Whatsapp": 13
}
}]
I use this to populate a dropdown list, but when I make a POST request to ‘/api/v2/tickets
’ with the source
field set to ‘12’ (Bot), I receive an error saying:
{"description":"Validation failed","errors":[
{"field":"source","message":"It should be one of these values: '1,2,3,5,6,7,8,9,11,10'","code":"invalid_value"}
]}
If these options are invalid then why are they in the ‘ticket_fields’ endpoint as choices?