How to Display Custom Error Messages for Multiple Field Validators in JMWE (Jira Cloud)

How to Display Custom Error Messages for Multiple Field Validators in JMWE (Jira Cloud)

Overview

This article explains how to configure a custom validator in Jira Misc Workflow Extensions (JMWE) for Jira Cloud, allowing you to check multiple custom fields in a single condition and display dynamic, user-defined error messages for each field. This approach is useful when you want to provide specific feedback to users, rather than a generic error message, when required fields are missing or invalid.


Use Case

A common requirement is to validate several custom fields during a workflow transition and show a tailored error message depending on which field is missing or invalid. Instead of creating separate validators for each field, you can use a single scripted validator to handle all checks and return custom messages.


Solution

JMWE's Build-your-own (scripted) Validator lets you use a Jira expression to perform complex validations and return custom error messages.

Example Script

Suppose you have three custom fields: Field A, Field B, and Field C (replace with your actual custom field IDs, e.g., customfield_10122).

fieldA = issue.customfield_10122; fieldB = issue.customfield_10123; fieldC = issue.customfield_10124; if (!fieldA) { return "Field A is required."; } else if (!fieldB) { return "Field B is required."; } else if (!fieldC) { return "Field C is required."; } else { return true; }
  • This script checks each field in order.

  • If a field is missing, it returns a specific error message.

  • If all fields are present, it returns true and the transition proceeds.

How to Configure

  1. Edit your workflow and select the transition where you want to add the validator.

  2. Click Validators and add a new validator.

  3. Choose Build-your-own (scripted) Validator (JMWE app).

  4. Set Choose type to Jira Expression.

  5. Paste the script above into the Jira expression field.

  6. Optionally, add a general error message in the Error message field (this is used if the script returns false or a non-string value).

  7. Click Add and publish your workflow.

For more details, see the official documentation:
👉 Build-your-own (scripted) Validator


If you need further assistance, please contact Appfire Support https://appfire.atlassian.net/servicedesk/customer/portal/11 .