Hello guys!
I'm facing a problem when trying to update resolution using IssueInputParameters object.
My code runs normally without errors, but the resolution field isn't stored.
A curious fact is that whether I use IssueManager.updateIssue method the update occurs perfectly.
Someone has any idea of why IssueInputParameters doesn't work correctly?
IssueInputParameters issueInputParameters = ComponentAccessor.getIssueService().newIssueInputParameters();
issueInputParameters.setSkipScreenCheck(true);
issueInputParameters.setResolutionId("10100");
IssueService issueService = ComponentAccessor.getIssueService();
UpdateValidationResult updateValidationResult = issueService.validateUpdate(getApplicationUserAdmin(), issue.getId(), issueInputParameters);
if (updateValidationResult.isValid()) {
IssueResult issueResult = issueService.update(getApplicationUserAdmin(), updateValidationResult, EventDispatchOption.DO_NOT_DISPATCH, false);
if (!issueResult.isValid()) {
log.error("Error updating Issue [" + issue.getKey() + "]\n" + issueResult.getErrorCollection());
}
else {
reindexIssue(issue);
}
}
else {
log.error("Error of validation (update Issue [" + issue.getKey() + "])\n" + updateValidationResult.getErrorCollection());
}
Kindly make sure that the Resolution field is on the Edit screen
Thanks @Alexey Matveev for your reply.
The field Resolution is not in edit screen.
I'm using issueInputParameters.setSkipScreenCheck(true);
I was hoping that was enough since the object IssueManager works fine and the field continues doesn't showing in edit screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the code that works.
issue.setResolutionId("10100");
IssueManager issueManager = ComponentAccessor.getIssueManager();
issueManager.updateIssue(
getApplicationUserAdmin()
,issue
,UpdateIssueRequest.builder().eventDispatchOption(EventDispatchOption.DO_NOT_DISPATCH).sendMail(false).build());
reindexIssue(issue);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.