Does Jira fire issue commented event when someone comments on portal through a popup?

Marina Veselić March 12, 2020

Hi!

We have a Service desk project (JSD) and sometimes there is a linked Development issue that is part of a Jira software project (RUN). We have set up a listener that copies the comment from the JSD issue to the RUN issue. It listens to the Issue commented event. 

The script works fine when someone comments on the portal through the comment section or the mail. The problem occurs when the customer transitions the issue through the transitions that are shown on the portal. The popup opens, the comment is entered, the transition is made. Also, there is a comment on the JSD issue, but not on the RUN issue. The listener didn't start, so I assume that the Issue commented event was not triggered.

Is my assumption correct? Is that something by design? Is there a workaround?

I can try to set the listener up for issue updated events, but that cannot work because, how will I know if the user did put in a comment?

Thanks for any input!

Cheers,

Marina

1 answer

0 votes
Daniel Milovanovic July 31, 2020

Same issue here! Any solution on this?

Daniel Milovanovic June 21, 2021

We were able to fix this by expanding the events to "Issue Commented" AND "Generic Event". The script looks like this:

def linker = ComponentAccessor.getIssueLinkManager()
def commentMgr = ComponentAccessor.getCommentManager()
def issue = event.issue as MutableIssue
def newComment = event.getComment()
ApplicationUser autoUser = ComponentAccessor.getUserManager().getUserByKey("jira-auto-user");

if (newComment != null) {
def commentBody = newComment.getBody()
linker.getOutwardLinks( issue.getId() ).each {
commentMgr.create(it.getDestinationObject(), autoUser, commentBody , true)
}
} else {
log.warn("No Action - Comment not found on this event!")
}

Suggest an answer

Log in or Sign up to answer