Ignore updates to certain fields

Originally asked by Lars Tange on 17 January 2022 (original question)


We are setting up a syncronization of incidents and attached SLA records from servicenow to JIRA.

As i understand any change to the records will trigger a sync.

On the SLA records however, there is a field ā€œElapsed business durationā€ which is updated very frequently. We donā€™t want to sync that field and we donā€™t want a sync to be triggered everytime this field is updated.

Is there a way to ignore changes to this field?


Answer by Francis Martens (Exalate) on 17 January 2022

If an incident is under sync, each time that there is an update - Exalate for ServiceNow will poll for that incident and run the outgoing sync processor.

If the result replica object is identical to the previous replica object or if the replica object is empty, no sync transaction will be triggered (and the change ignored)

Your requirement is met if the field ā€˜Elapsed business durationā€™ is not copied into the replica (and no other field changed)


Comments:

Lars Tange commented on 18 January 2022

Thanks - great answer. So in the below script, assuming that the only field changing is the business_duration, a sync will only happen if active = false?

if(entity.tableName == ā€œtask_slaā€) {
replica.incident_number = entity.task.display_value
replica.sla = entity.sla.display_value
replica.breach_time = entity.planned_end_time
replica.has_breached = entity.has_breached
replica.end_time = entity.end_time
replica.stage = entity.stage
if (entity.active == false)
replica.business_duration = entity.business_duration
}

Francis Martens (Exalate) commented on 18 January 2022

Looks indeed correct - the proof of the pudding is in the eating (old community)

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