Code looks like this:
IssueInputParameters pNewIssueInputParameters = issueService.newIssueInputParameters();
pNewIssueInputParameters.setFixVersionIds(pNewIds);
UpdateValidationResult pValidationResult = issueService.validateUpdate(aUser, aIssue.getId(), pNewIssueInputParameters); if(pValidationResult.isValid()){ if(logger.isInfoEnabled()){ logValidationResults(pValidationResult); } IssueResult pUpdateResult = issueService.update(aUser, pValidationResult,EventDispatchOption.ISSUE_UPDATED,false); if(!pUpdateResult.isValid()){ logger.error("Can't update issue: "+aIssue.getKey()+". Reasons:"+ pUpdateResult.getErrorCollection()); } }else{ logger.error("Can't update issue: "+aIssue.getKey()+". Reasons:"+ pValidationResult.getErrorCollection()); }
My first thought was that there is something wrong with security context. So before calling issue service I added something like this
JiraAuthenticationContext pJiraAuthenticationContext = ComponentAccessor.getJiraAuthenticationContext(); pJiraAuthenticationContext.setLoggedInUser(pUser);
Things became better now and on developer jira instace its started to work. Unfortunatelly on testing env it doesn't.
Interesting thing is that on dev env - before adding:
pJiraAuthenticationContext.setLoggedInUser(pUser);
there was no entry in Map returned pValidationResult.getFieldValuesHolder() about new fixversions.
Maybe you can post your code here?
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.