Hi,
I clone the records opened on the jira service desk to the software project. I copy the comments with the Listener feature (comment event). There is no problem in the outward part, but I do not copy the comments to the software project as inward. Does anyone have any suggestions?
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.comments.MutableComment;
import com.atlassian.jira.issue.comments.CommentManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.user.ApplicationUser;
CommentManager commentMgr = ComponentAccessor.getCommentManager()
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().loggedInUser
//IssueManager im = ComponentAccessor.getIssueManager();
//MutableIssue issue = im.getIssueObject("YAZ-2")
def issue = event.issue
def lastComment = commentMgr.getComments(issue).last().body
//def links = ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId())
def links = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())
//return links[0].getSourceObject()
def output = ""
for(l in links) {
// Outward Linki için kullanıyoruz
output = output + l.issueLinkType.name + ": " + l.getDestinationObject() + "<br/>"
// Inward Linki için kullanıyoruz
//output = output + l.issueLinkType.name + ": " + l.getDestinationObject() + "<br/>"
commentMgr.create(l.getDestinationObject(), currentUser, lastComment, false)
}
//return output