I tried reproducing your requirements with following code,
document.onreadystatechange = function () {
if (document.readyState === 'interactive') renderApp();
function renderApp() {
var onInit = app.initialized();
onInit.then(getClient).catch(handleErr);
function getClient(_client) {
window.client = _client;
client.events.on('app.activated', onAppActivate);
}
}
};
function onAppActivate() {
var textElement = document.getElementById('apptext');
var getContact = client.data.get('contact');
getContact.then(showContact).catch(handleErr);
client.events.on('ticket.propertiesUpdated', function getPayloadonUpdate(event) {
console.log(event.type + ' event occurred');
var event_data = event.helper.getData();
console.log('eventdata', event_data);
});
function showContact(payload) {
textElement.innerHTML = `Ticket created by ${payload.contact.name}`;
}
}
function handleErr(err) {
console.error(`Error occured. Details:`, err);
}
With this sample I tried to do two things
I saw if getPayloadonUpdate(..) being triggered without hitting the update button in I could see the event_data only when user clicks the update button.
I created a custom field that reflects date. In this case, what you reported is accurate.
I get following event data:
I can see date custom field’s value doesn’t have DD-MM-YYYY associated with it.
For #1, can you share an example code that can help me reproduce event payload triggered even if ticket property is not updated as you claim?
@Tejasri_Kalluri - From the video I can understand the following:
The ticket had priority ‘High’ by default.
User clicks on “update”
You receive the “High” priority in the payload.
In case, if the user changes to “Low” and clicks on “update” the payload should expect to have “Low” in the argument passed to getPayloadonUpdate(..)
The above approach is the default behavior I know of. But did you prefer anything differently? Did you see the change event without any change should send something similar to “null” in the payload given no change happened instead of latest (which is also existing) change on “update” button click by user?