Hi, I created a comment listener when a user adds a comment to an issue, the listener adds the same comment to the linked issue. It is working fine with Jira software projects, I tested with two Jira Software projects. However, it's not adding comments to Service Desk linked issue. There is a service desk issue link to the Jira software issue. I want to be able to add comments in Jira software and it should be added to the Service Desk issue too but it's not working with SD. Any idea why it works with Jira software but won't work with Service Desk? What I'm missing?
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.link.IssueLink;
import com.atlassian.jira.issue.comments.CommentManager;
import com.atlassian.jira.user.ApplicationUser;
CommentManager commentMgr = ComponentAccessor.getCommentManager()
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().loggedInUser
def issue = event.issue
def lastComment = commentMgr.getComments(issue).last().body
def links = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())
def output = ""
for(l in links) {
output = output + l.issueLinkType.name + ": " + l.getDestinationObject() + "<br/>"
commentMgr.create(l.getDestinationObject(), currentUser, lastComment, false)
}
Thank you for your help.