I want to update the status from all issues in a proejct with this code, but it doesnt work:
But if i just update the description this works fine, but not for the status.
I tried different ids but nothing helped.
Collection<Long> issueIds = getIssuesIdsFromProject(clonedProject);
IssueService issueService= ComponentAccessor.getIssueService();
for(Long id:issueIds){
MutableIssue issue=getIssueFromId(id);
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
issueInputParameters.setStatusId("1");
UpdateValidationResult updateValResult = issueService.validateUpdate(currentUser, issue.getId(), issueInputParameters);
if(updateValResult.isValid()){
IssueResult updateResult = issueService.update(currentUser, updateValResult);
}else{
throw new RuntimeException("Status for Issue" + issue.getKey() + "not valid");
}
}
Is this even possible with the setStatusId Method or do i need to traverse all transtion actions which would be much more effort to implement?