cf_product_type is custom dropdown field that has the exact same value being passed as an option.
Request on Custom APP server.js file
const key = '{{key}}';
const freshEndpoint = 'https://{{domain}}.freshdesk.com/api/v2/tickets/' + options.ticket_id;
const callOptions = {
method: 'put',
body: JSON.stringify({
custom_fields: {
cf_policy_numbers: options.policy_number,
cf_product_type: options.policy_type,
}
}),
headers: {
'Authorization': 'Basic ' + buffer.from(key + ':X').toString('base64'),
'Content-Type': 'application/json'
}
};
fetch(freshEndpoint, callOptions).then(res => res.json()).then((res) => {
console.info('RESPONSE', res);
if(res === 'No Data Found') {
renderData(null, JSON.stringify({
notFound: true
}));
}
renderData(null, JSON.stringify(res));
});
Error from logs:
Url to update ticket field https://{{domain}}.freshdesk.com/api/v2/tickets/90919
RESPONSE {
description: 'Validation failed',
errors: [
{
field: 'cf_product_type',
message: 'Unexpected/invalid field in request',
code: 'invalid_field'
}
]
}