How do I reference the original values of the changed fields using Groovy?

To reference the original value of the changed field using Groovy, use the getOriginalAttributeValue() function.

When you use the getOriginalAttributeValue() function, use the following example by substituting your field's name for Priority_c.

// Assuming we're using TroubleTicket object

if (isAttributeChanged('Priority_c'))
{
def curPri = Priority_c def origPri = getOriginalAttributeValue("Priority_c")
adf.util.log("Priority changed: ${origPri} -> ${curPri}") // do something with the curPri and origPri values here
}