Workflow validator - block while the message is shown

Message Field includes a workflow validator, Message Field: block while the message is shown. It turns a message into a rule: while the message would be shown on the issue, the transition (or the issue creation) is rejected, and the user sees the message itself as the reason.

Available from Message Field DC 5.7.0.


Add the validator to a transition

  1. Go to Administration → Issues → Workflows and edit the workflow.
  2. Select a transition, open Validators and click Add validator.
  3. Choose Message Field: block while the message is shown.
  4. In Message configuration, pick the configuration whose conditions should block the transition. The list shows each configuration as field - configuration title.
  5. Save the validator and publish the workflow.

The validator can be added to any transition, including the Create transition of the workflow.


When the transition is rejected

The validator evaluates the display conditions of the selected message configuration on the issue - date and time, JQL, statuses, linked issues, permissions. Screens are not taken into account: the condition “show on Issue Create / Transition screen” does not matter for the validator, only whether the message would be shown on the issue at all.

If the conditions are met, the transition or the creation is rejected:

  • the error shows the message title and the message text as plain text (HTML markup is removed);
  • if the message text is empty after rendering, a generic rejection text is shown instead.

What is blocked and what is not:

Action Blocked
Workflow transition with the validator Yes
Issue creation (validator on the Create transition) Yes
Request creation on the JSM customer portal (validator on the Create transition) Yes
Issue edit (Edit screen, inline edit) No - validators run only on transitions

On a transition, a dynamic template of the message sees the issue as it is before the transition: field values, status and links before the change.


When the validator does not block (fail-open)

The validator never blocks when it cannot decide. In these cases the transition or creation goes through:

  • Create with a JQL condition or a linked-issues condition. On creation the issue has no key yet, so these conditions cannot be evaluated.
  • The message configuration was deleted. The validator still points to it, but there is nothing to evaluate.
  • The template marked the message as hidden (for example with $fieldDisplayConfig, see How to hide a message?).
  • The template failed to render. A rendering error never blocks users.
  • No valid license. Without an active Message Field license the validator lets everything through.

Example: require a field before resolving

  1. Create a Message Field configuration with the title Fill in the root cause first and a JQL condition "Root cause" is EMPTY (see Advanced settings).
  2. Add Message Field: block while the message is shown to the Resolve transition and select that configuration.
  3. While Root cause is empty, the message is shown on the issue and Resolve is rejected with the message title and text. Once the field is filled in, the message disappears and the transition goes through.