Hi, everyone!
I don't understand why my code only works with the "Issue Updated" event, but not with the other "CustomFieldUpdatedEvent" event?
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.link.IssueLink;
import java.text.SimpleDateFormat
import java.util.Date
import java.time.temporal.ChronoUnit
import java.time.ZoneId
import static java.time.DayOfWeek.*
def change = event?.getChangeLog()?.getRelated("ChildChangeItem").find {it.field=="myCFname"}
if (change){
def issue = event.getIssue()
....//
....//
Any help is important thanks.
Hi @Alex ,
for my knowledge CustomFieldUpdatedEvent is not an event that a listener can catch. You correctly need to use IssueUpdated and then use changelog to figure out if a specific field has been updated during that operation.
List<GenericValue> changedItems = event.getChangeLog().getRelated("ChildChangeItem");
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.