Variable assignment in dynamic error messages doesn't work in JMWE for Jira Cloud
Problem
JMWE for Jira Cloud uses Jira expressions for Conditions and Validators. These expressions are processed on the Jira instance itself, rather than on JMWE instances operated by Appfire.
Using variable expressions to set dynamic error messages with Jira expressions that are derived from Atlassian’s documentation doesn’t work with JMWE’s Build-your-own (scripted) validators or conditions. However, the code works without error in JMWE’s Jira expressions tester. For example:
let issueKey = issue.key;
`The issue is ${issueKey}`This code returns the issue key in the Jira expression tester, but when used in a JMWE Build-your-own (scripted) condition or validator, it returns the message:
“The issue is “
With a blank value for the ${issueKey} variable.
Solution
We have identified a known issue with variables embedded in a Jira expression using $; these variables are not working correctly in conditions and validators. While we are unsure if this is a known issue to Atlassian, we have identified workarounds that will allow for dynamic error messages to still be set.
The following code is a version of the script example above that works with scripted validators and conditions:
let issueKey = issue.key;
return "The issue is " + issueKey;