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
I guess there are two entries in Error Collection?
Do you know how to check that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for (String error: errorCollection){
log.debug("inside error collection" +error)
UserMessageUtil.error("Error : ")
}
if this code is being executed twice, then you have 2 items in the collection.
Simply concat them and run the UserMessageUtil after the for loop closes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.