Ricerche recenti


Nessuna ricerca recente

Sean Russell's Avatar

Sean Russell

Data ingresso 13 mag 2021

·

Ultima attività 22 ott 2021

Seguiti

0

Follower

0

Attività totali

8

Voti

3

Abbonamenti

4

PANORAMICA ATTIVITÀ

Ultima attività di Sean Russell

Sean Russell ha creato un post,

Post Developer - Zendesk APIs

I need to be able to update a ticket's custom_field value with an integer via ZAF Client request (the field "type" is "integer"). Using the request options below, the request is successful and the correct ticket field is updated, however the value is a String instead of Integer. This isn't a huge issue, but will require parsing the value to an integer when reading it, which isn't ideal. Is there a way to change my request to preserve the value's numeric datatype?

The request looks like this:

const options = {
url:`/api/v2/tickets/${ticketID}.json`,
type:"PUT",
contentType:'application/json',
dataType:"json",
data: JSON.stringify({ticket: {custom_fields: [{id: 1500003010701, value: 12}]}}),
}
client.request(options)

And the resulting ticket field looks like this:

{
"id": 1500003010701,
"value": "12"
}

Is there a way to ensure the value will be an Integer (12) rather than a String ("12") ?

Data ultimo post: 12 apr 2021 · Sean Russell

0

Follower

2

Voti

1

Commento