Hi All
Is there a way to keep comments in sync between two cloned issues?
Rahul
You will need to write a listener to keep the comments in sync.
<code class="java keyword"><br>
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
com.atlassian.jira.event.issue.AbstractIssueEventListener
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
);
}
It looks like you're new here. Sign in or register to get started.