In this recipe, we will see how to programmatically create an issue from a plugin. Prior to Version 4.1, JIRA used
IssueManager to create an issue. From JIRA 4.1, there is this
IssueService class that drives the issue operations. Since
IssueService is recommended over
IssueManager, we will use it in our recipes to create an issue.
The main advantage of using
IssueService over the
IssueManager class is that it takes care of the validation and error handling. The following are the steps to create an issue using the
IssueServiceclass. You can either inject it in the constructor or get it from the
ComponentAccessorclass, as shown:
IssueService issueService ...