Can I use Script Runner's Clone Issue to copy comments?

This seems like something I should be able to supplement within the configuration of Script Runner's clone issue template.  I'm sure if I had the correct code to execute as an additional issue function, I could implement it.  I'm just not knowledgable to come up with it myself, yet.  Any help from those smarter than myself is greatly appreciated! 

2 answers

This widget could not be displayed.

Have a look at You would iterate the comments on the source issue, and create corresponding comments on the target issue.

This widget could not be displayed.


I tried this approach with the following script in the post function:


import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.component.ComponentAccessor

CommentManager commentMgr = ComponentAccessor.getCommentManager();
Collection<Comment> comments = commentMgr.getComments(sourceIssue);
for (Comment comment : comments) {
    commentMgr.create(issue, comment.getAuthorApplicationUser(), comment.getBody(), false);


But I always got

[scriptrunner.jira.workflow.ScriptWorkflowFunction] Script function failed on issue: ..., file: null


    at com.atlassian.jira.issue.comments.DefaultCommentManager.create(


Any advice on this?



Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

169 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you