Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-67797

Custom validator error messages are not displayed to users

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.3.3, 7.11.2, 8.0.2
    • Java API

      Summary

      When multiple validators are configured for a transition, Jira does not display user-level exception from the custom validator, showing generic system-level exception instead:

      admin.errors.exception com.atlassian.jira.exception.CreateException: Error occurred while creating issue through workflow:

      Steps to Reproduce

      1. install JSU plugin.
      2. Edit project's workflow, "Create" transition
      3. Add a new validator, e.g. "Required field", add "Comment" to the required field, f.e.
      4. Set the custom exception message that supposed to be displayed to users
      5. Save, publish
      6. Try to clone any issue

      Expected Results

      Custom error message should be shown to the user, allowing him to correct the mistake

      Actual Results

      The below exception is thrown in the xxxxxxx.log file:

      2018-08-16 12:33:58,705 JiraTaskExectionThread-4 ERROR dmadmin 753x1268x1 xwgb7e 0:0:0:0:0:0:0:1 /secure/CloneIssueDetails.jspa [c.a.j.bc.issue.DefaultIssueService] Error occurred while creating issue through workflow:
      com.atlassian.jira.exception.CreateException: Error occurred while creating issue through workflow:
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:516)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssueObject(DefaultIssueManager.java:608)
      	at com.atlassian.jira.issue.managers.RequestCachingIssueManager.createIssueObject(RequestCachingIssueManager.java:209)
      	at com.atlassian.jira.bc.issue.CloneIssueCommand.call(CloneIssueCommand.java:133)
      	at com.atlassian.jira.bc.issue.CloneIssueCommand.call(CloneIssueCommand.java:61)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:458)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:426)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: [InvalidInputException: [Error map: [{comment=comment?}]] [Error list: [[]]]
      	at ch.beecom.jira.jsu.util.ValidatorErrorsBuilder.process(ValidatorErrorsBuilder.java:47)
      	at ch.beecom.jira.jsu.workflow.check.AbstractCheck.validate(AbstractCheck.java:97)
      	at com.atlassian.jira.workflow.SkippableValidator.validate(SkippableValidator.java:45)
      	at com.opensymphony.workflow.AbstractWorkflow.verifyInputs(AbstractWorkflow.java:1466)
      	at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1167)
      	at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:742)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:510)
      	... 11 more

      Notes

      This problem has been reported multiple times in the past, and it is marked as fixed, but I just tested in 7.11.2 and the problem is still there.

      This issue also affects JSU plugin, and many users of this plugin who are not able to use the plug-in validators functionality to the full extent because of it.

              Unassigned Unassigned
              apatyuchenko Andrey Patyuchenko
              Votes:
              29 Vote for this issue
              Watchers:
              36 Start watching this issue

                Created:
                Updated: