I want to ask about something that is working to my benefit but I am not sure that I understand why it happens that way.
I am using onIssueEvent method for handling issue events, including "issue updated" event. In my event handler I call IssueManager.updateIssue() for another issue and the update event is intentionally dispatched for the target issue:
@EventListener
public void onIssueEvent(IssueEvent issueEvent){
log.debug("handling update for " + issueEvent.getIssue().getKey());
/* some event handling code */
issueManager.updateIssue(user,
targetIssue,
EventDispatchOption.ISSUE_UPDATED,
false);
/* some more event handling code */
log.debug("handled update for " + issueEvent.getIssue().getKey());
}
In an example based on the data on my system:
Somehow the log output I get is something like below:
handling update for A
handling update for B
handling update for C
handled update for C
handled update for B
handled update for A
First, I was expecting IssueManager.updateIssue() method to fire an event that would be handled AFTER the current event handler finishes but somehow it acts like a method call. My event handler for Issue A resumes after B and C are finished handling their events.
Second, I was expecting to face an infinite loop and was prepared to search for a way to break it but the event handler on issue C does not dispatch an update event back to issue A, even tough it is instructed to do so.
So, all of these are against my expectations. Can someone shed a light on why it is happening this way?
(Jira 7.5.0)
Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.
Get Certified! ✍️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.