Many exceptions in the same Groovy script validator

Hello,

I am trying to improve my User Experience by grouping all validators in one unique validator to display only 1 error message during transition. 

Let say I want to check that: 

- the field Assignee is not empty

- time has been logged if no time was logged on the issue before

Until now, I was using 2 validators: Fields required and Script Validator. But 2 error messages

I am now using 1 Scipt validator to check Assignee AND time spent. I would like my error message to appear on the field on not above the transition screen.

Is it possible to have several exceptions displayed on many fields? How to do it? 

Thank you for your help

Romain

1 answer

1 accepted

Hey!
Just to share with the Community, we found the solution. You can create your exception and then add errors one by one on the fields you want. They will be displayed under each field and not on front of the transition screen.

invalidInputException = new InvalidInputException()
invalidInputException.addError("worklog_timeLogged",error_time_spent)
invalidInputException.addError(ef.id,error_estimated_effort)

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Service Desk

Wy are we still using email for Service Desk workflows?

...attest to the experience of an urgent approval that gets lost in the boss’s inbox and requires that special “Please Approve” email or text message. In an age where we have distributed teams...

90 views 0 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you