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?
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
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:
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?