I am writing a listener in groovy that checks the Fix Version on Issue Updated Event but I get NULL for oldstring when I call it from the code.
Here is a snip of the code.
change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "Fix Version"}
log.warn(change)
//log.warn("all changes : "+ event?.getChangeLog()?.getRelated("ChildChangeItem"))
log.warn("--------Vairables created")
if(change)
{
log.warn("old string is " + change.oldstring)
log.warn("new string is " + change.newstring)
if(change.oldstring == ver || change.newstring == ver)
{
if(change.oldstring == ver)
{
subject = "An item was added to " + ver
body = "Ticket " + issue.getId() + " was added to " + ver
}
if(change.newstring == ver)
{
subject = "An item was removed from " + ver
body = "Ticket " + issue.getId() + " was removed to " + ver
}
When testing this I am selecting edit on the ticket. Removing the old fix version and adding a new fix version. The old one is always NULL.
Using v8.13.2