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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.