I’m trying to add status changes as comments using this:
if (!replica.status.equals(previous?.status)) {
// construct the comment
String message = "${replica.key}: Status updated from '${previous?.status?.name}' to '${replica?.status?.name}'"
issue.comments = commentHelper.addComment(message, issue.comments)
}
However, I keep getting the error:
No such property: previous for class
What am I missing?
Comments:
Francis Martens (Exalate) commented on 18 November 2019
Can you provide the whole incoming sync script?
The previous replica is not available when doing the first synchronisation.
if (!firstSync && !replica.status.equals(previous?.status)) {
// construct the comment
String message = "${replica.key}: Status updated from '${previous?.status?.name}' to '${replica?.status?.name}'"
issue.comments = commentHelper.addComment(message, issue.comments)
}
Works now. Thanks so much!
Comments:
Francis Martens (Exalate) commented on 19 November 2019
We will be adding previous also in the firstSync, but keep it empty such that it doesn’t throw this horrific error.