I'm developing a JIRA plug-in and have a method which passes a custom Incident object which I populate after parsing input from a mail handler, and then the method creates a JIRA issue based off of those values. Everything works and the issue is created, however, setComponentIds on IssueInputParameters is not actually setting the component IDs I'm passing. The Incident object member componentIds is a Long[] and I've confirmed through debugging that it contains multiple Long values as expected. I've also confirmed that the Components field is on the edit screen for this specific project and that the Component IDs I'm passing are valid for the project I'm creating the issue in. The code is below, any ideas?
public void createIssue(ApplicationUser user, Incident incident) throws CreateException {
JiraAuthenticationContext authContext = ComponentAccessor.getJiraAuthenticationContext();
authContext.setLoggedInUser(ComponentAccessor.getUserManager().getUserByKey(user.getKey()));
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
issueInputParameters.setSummary(incident.getTitle())
.setDescription(incident.getAlertMessage())
.setPriorityId(incident.getPriority())
.setComponentIds(incident.getComponentIds())
.setAssigneeId(null)
.setReporterId(incident.getReporter())
.setProjectId(incident.getProjectId())
.setIssueTypeId(incident.getIssueTypeId());
IssueService.CreateValidationResult result = issueService.validateCreate(user, issueInputParameters);
if (result.getErrorCollection().hasAnyErrors()) {
throw new CreateException(result.getErrorCollection().getErrors().toString());
} else {
issueService.create(user, result);
}
}