Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

setResolution not working usind IssueInputParameters

Mário dos Santos _TOTVS_ May 8, 2018

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());
}

 

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 2018

Kindly make sure that the Resolution field is on the Edit screen

Mário dos Santos _TOTVS_ May 8, 2018

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.

Mário dos Santos _TOTVS_ May 8, 2018

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);

Suggest an answer

Log in or Sign up to answer