Value from custom_fields

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?

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
   );

@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.

From the docs I see this:

Snippet from beginning of code:

Log from terminal:
image

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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.