Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

IssueService only partly updates issue

Angelo Hannes September 4, 2015

I try to update an issue within my plugin. I'm using IssueService for that. See the following code.

IssueInputParameters issueInputParameters = getIssueService().newIssueInputParameters();
issueInputParameters.setSummary("I am a new summary");
issueInputParameters.setDescription("Some awesome new description");
issueInputParameters.setTimeSpent(4560L);
issueInputParameters.setFixVersionIds(idList.toArray(new Long[1]));
issueInputParameters.addCustomFieldValue(SyncListenerConfig.CUSTOMFIELD_PLANVERSION, newValue);

UpdateValidationResult updateValidationResult = getIssueService().validateUpdate(ApplicationUsers.from(event.getUser()), linkedIssue.getId(), issueInputParameters);
if (updateValidationResult.isValid())
{
    IssueResult updateResult = getIssueService().update(ApplicationUsers.from(event.getUser()), updateValidationResult);
    if (!updateResult.isValid())
    {
        System.out.println("BUUUUHUHHHHHHHHHHH!!!!");
    }
}

It does update the summary and description. But it doesn't update the timeSpent, fixVersionIds and the custom field.

What am I missing here? There are no errors in the log or in any result object.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Jobin Kuruvilla [Adaptavist]
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.
September 4, 2015

Are those fields available on the edit screen?

Angelo Hannes September 4, 2015

No, they aren't.

Jobin Kuruvilla [Adaptavist]
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.
September 4, 2015

Add the following to your code and see if it helps. issueInputParameters.setSkipScreenCheck(true);

Angelo Hannes September 4, 2015

thanks, that was it.

TAGS
AUG Leaders

Atlassian Community Events