I am writing a listener to create an issue. I would like throw the errors on to the jira UI.
I am trying something like below
IssueService.CreateValidationResult createValidationResult = issueService.validateCreate(currentUser, issueInputParameters)
log.error("Validation?: {}" +createValidationResult.isValid())
log.error(createValidationResult.getErrorCollection())
if (createValidationResult.isValid())
{
log.error("entrou no createValidationResult")
IssueService.IssueResult createResult = issueService.create(currentUser, createValidationResult)
if (!createResult.isValid())
{
log.error(createResult.getErrorCollection())
log.error("Error while creating the issue.")
def errorCollection=createResult.getErrorCollection().getErrors().values();
for (String error: errorCollection){
log.debug("inside error collection" +error)
UserMessageUtil.error("Error : ")
}
}
}
It is throwing error,but it is happening twice. ANy idea why is it so