I'm trying to write a plugin module to show subtask comments in the screen for a parent issue. Here's what I've got so far:
public class SubtaskCommentsIssueTabPanel extends AbstractIssueTabPanel implements IssueTabPanel
{
private static final Logger log = LoggerFactory.getLogger(SubtaskCommentsIssueTabPanel.class);
public List getActions(Issue issue, User remoteUser) {
List<IssueAction> issueactions = new ArrayList();
Collection<Issue> subtasks = ComponentAccessor.getSubTaskManager().getSubTaskObjects(issue);
for (Issue subtask : subtasks) {
List<Comment> comments = ComponentAccessor.getCommentManager().getComments(subtask);
for (Comment comment : comments) {
issueactions.add(comment);
}
}
return issueactions;
}
public boolean showPanel(Issue issue, User remoteUser)
{
return true;
}
}
This doesn't compile, because on line 16 I'm trying to add a Comment to a List<IssueAction>. If I return a List<Comment>, then nothing appears in the new tab.
How can I make this work? Admittedly I'm new to Java as well so this process has involved a lot of throwing stuff at the wall and seeing what sticks.