Interface trigger setValue not setting the value of the correct field

i am attempting to set two values in an custom app using the interface trigger “SetValue” butit is updating a different field

here is the code

client.interface.trigger("setValue", {id: "cf_alertresolved", value: "Yes"})

client.interface.trigger("setValue", {id: 'alertresolved', value: true})

both of these calls are updating the same field even though there are two

these to fields in the json for the ticket are

{
"alertresolved": false,
"cf_alertresolved": "No"
}

alertresolved is a check box
cf_alertresolved is a drop down list

any idea why the different field ids are affecting the same field

@Nabbs,
As per the document, there is no such a field called alertresolved,
if that is a custom field, by default prefix will add i.e cf_xxxx and it should not be duplicated.
I would suggest changing one of the field names to any other name.

Hope it helps :slight_smile:

Thanks

Hi,

yes both fields are custom fields

so are you saying that the system will add the ‘cf_’ to any field mention in ‘client.interface.trigger(“setValue”, {id:’ if it is custom?

if that is true i would say there is an issue as one field name contains a _ which the system seems to be ignoring, should it not be cf__alertresolved and cf_alertresolved

how would i go about changing the name as when i change the field in freshservice it dosen’t show any difference on the api or sdk when pulled out?

@Nabbs You can make a GET API for one of the tickets with a value for both the custom fields and check if there are changes in the field names.

If there’s no change in the field names, it could be the case as you have mentioned. In that case, the Freshservice portal can be ignoring the “_” character in the field names.
If you could confirm the names you see from the GET API, I could check with the Freshservice team about it and confirm.

1 Like

@Nabbs, Just checking in if you got the help that you need. Is there something that still needs any help on this topic?