Style Workflow Exception Message for the User

Hi community,

I’m a bit new in Jira development.

I implemented some simple workflow validators (for example - “customfield not empty validator”) for Jira dc 10.0.1

If my validate() fail I throw a WorkflowException with a message.

...throw new WorkflowException("############## The selected field: "+ fieldname + " must be filled. ###########");

The result for the user is:

My question is - how can develop are more intuitive Error Screen for my users? It failed when I try to use HTML tags or include “\n” in the message.

The best case would be just to show the message styled with html tags.

thanks.

best regards
Thomas

Ideally you should throw an com.opensymphony.workflow.InvalidInputException instead of a WorkflowException.
This still wont get you any styling. For that you could add a unique string to your exception message and add some JavaScript resource that checks for the unique string and replaces the default HTML with your custom HTML.

1 Like

thanks - i think that will work for me.