I have an incoming sync error on a ServiceNow node. It looks like to resolve this, the script needs to end if the state of the target record is “Closed”. So far, I’ve not successfully scripted this workaround. I am not sure the ServiceNow node can know the value of a field on the target record before the update. Is it possible to check the target record’s state field value from within incoming sync rules on the ServiceNow side before making a decision whether to proceed with the sync?
I had the same issue when we were setting up our sync. This works very well for us:
if(replica.state \=\= "Canceled" \|\| replica.state \=\= "Closed"){workItem.comments \= commentHelper.addComment(
"State was set to "\+replica.state\+" in serviceNow. Unexalating now.", workItem.comments)
syncHelper.unExalateAfterProcessing()
}
This also posts a message (if your target system is Azure DevOps at least) saying that the sync will stop in the comments from that point on.