Data Methods for getting selected values on New Ticket Page

Hi Everyone,
I am making an app in new ticket background where I want to get selected/entered values of particular fields(like custom dropdowns, subject, description, etc.). Is there any data/event/interface methods available to get those user selected values from the New Ticket page?

Any help is appreciated

Thanks

Hi @Aryan_Maloo ,

First of all apologies for the delay. Hope you are doing well.

You can listen for the change events using Events method in most of the placeholder where your apps are running, in your case I believe it’s “new_ticket_background”.

Here you can use the change events such as below:

Change event for Group field

var propertyChangeCallback = function (event)
// code to be executed when the group of the ticket is changed.
{
    var event_data = event.helper.getData();
    console.log(event.type + " changed from " + event_data.old + " to " +  event_data.new);
};
client.events.on("ticket.groupChanged", propertyChangeCallback); // Register the event to listen for group changes

In case you want to listen change events for any custom field, you can use the below code snippet:

function customFieldChange(event){
  const event_data = event.helper.getData();
  const cfField = Object.keys(event_data)[0];
  console.log("cfField",cfField); // the field which has changed.
  console.log("newValue",event_data[cfField].new); // gets the changed value
}

Prior to all these you must register these events on the appInitialized() callback function

client.events.on("app.activated", onAppActivated);

function onAppActivated() {
   client.events.on("ticket.customFieldChanged", customFieldChange);
}

Hope this helps you resolve your query! In case any further queries, happy to help. You can read more about this in the FDK Events methods

Happy Developing!

Hi @Jayanth_Kumar ,
Thanks for the reply. I have gone through the whole FDK documentation but I am not able to find ticket.customFieldChanged event. In the event methods for New Ticket Page there are only a few type of change events, they are:

Is this a new event which has not been documented yet?

Yes this is somewhat latest event which was introduced but the documents has not bee updated with this relevant information.

Hi @Jayanth_Kumar ,
Thank you for providing a solution. Are there any other new events that can be used on New Ticket Page which have not been documented yet?

1 Like

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