Ansfs91
(Albin)
February 13, 2023, 9:06am
1
Am getting the value undefined from an app when I have installed it in Freshservice.
When I run it locally (works local on my machine! ;D) I do get the value from the custom fields.
Any idea/tips/guidence how to best obtain the value from custom_fields?
Ansfs91
(Albin)
February 15, 2023, 9:09am
3
Hi team.
Any updates on this?
The serverless app is trigger on the event onTicketUpdate and the first thing the app i sdoing to console log the above with this code:
onTicketUpdateCallback: async function (args) {
console.log('--------------Starting the app--------------');
console.log(
'Value to trigger workflow:',
args.data.ticket.custom_fields.wfasequencesstage
);
Ansfs91
(Albin)
February 27, 2023, 9:41am
4
@zach_jones_noel Do you have an update about this?
Hey @Ansfs91 ,
Good day to you!
I believe you are parsing the custom fields with a different structure. Custom fields in Freshservice would have the following payload -
"data": {
"ticket": {
"custom_fields": [{
"name": "Org code",
"label": "Org code",
"column": "ffs_04",
"type": "dropdown",
"value": "XMO_12"
},
{
"name": "RCA",
"label": "RCA",
"column": "ffs_05",
"type": "dropdown",
"value": "fix steps were..."
}]
}
}
More info in product events docs .
Let me know if this helps.
Ansfs91
(Albin)
February 28, 2023, 7:43am
6
From the docs I see this:
Snippet from beginning of code:
Log from terminal:
custom_field ((singular) is returning undefined when I change it to custom_fields (plural) I get this from the logs:
Hence I see that the custom_fields is an object and i can get the value from it.
system
(system)
Closed
May 29, 2023, 7:43am
7
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.