Hi All
Is there a way to keep comments in sync between two cloned issues?
Rahul
You can solve it by using "Script Listeners" section of Script runner. Clone Issue and issue that was cloned should be linkedIssues. You can easily create a Custom listener triggered by the event "Issue Commented" and add a script similar to this one.
import
com.atlassian.jira.component.ComponentAccessor
import
com.atlassian.jira.event.issue.AbstractIssueEventListener
import
com.atlassian.jira.event.issue.IssueEvent;
public
class
CopyComments
extends
AbstractIssueEventListener {
@Override
void
workflowEvent(IssueEvent event) {
def linkedIssue =
"TEST-1"
;
def commentManager = ComponentAccessor.getCommentManager();
def issueManager = ComponentAccessor.getIssueManager();
def comment = event.getComment()
def targetIssue = issueManager.getIssueObject(linkedIssue);
commentManager.create(targetIssue, comment.authorApplicationUser, comment.body,
true
);
}
}
You will need to write a listener to keep the comments in sync.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.