Good day time dear collegues!
Developing jira plugin at the moment. So i need to comment Collection of issues. I use Comment manager and my code is pretty easy:
List<Issue> issues = results.getIssues();
Iterator<Issue> issuesIt = issues.iterator();
String gotCommentBody = "Start";
SimpleErrorCollection error = new SimpleErrorCollection();
while(issuesIt.hasNext())
{
Issue issue = issuesIt.next();
if(gotCommentBody!="")
{
CommentManager cm = ComponentManager.getComponentInstanceOfType(CommentManager.class);
Comment comment = cm.create(issue, "victor", gotCommentBody, false);// issue, author, text, throw event
}
}
And i've got an error here!
The first run of the cycle completes correctly and comments issue
At the second run of the cycle cm.create method throws "Cannot set or mutate an ImmutableGenericValue"
Does anyone one now what object is immutable? And why it only appears on the second run?
Thank you in advance!
Regards, Andrew.