Goal: Block access to a transition if the original estimate is zero or is empty.
I'm struggling to get this one operational for some reason. Using JMWE (jira misc workflow extensions) on a Validator within a step of a workflow, I use the 'Build-your-own (scripted)' type and supply this statement. When testing (within the configuration console) an issue without an original estimate, it yields true. When testing an issue whose original estimate is zero, this also returns true. I've further validated I get a false answer when the condition is not met (which is correct).
issue.originalEstimate == null || issue.originalEstimate == 0
When I publish the workflow and execute the transition through the UI, an issue who should answer true bypasses this validator and is allowed through.
I took it one step further and tried the 'Field Required - JMWE App' type as a validator. Here I use the same custom logic but it too fails to trap the issue (that returns false while testing from the console) so it bypasses validation.
I took things a third step further and tried just one side of the conditions logic (a section before or after the or statement) but it, too, results in the same bypassed validation.
There must be something unique about the `original estimate` property; I did a load of googling without an answer. Innovalog folks - you rock as always!
Hi @Paul Alexander ,
unfortunately, when you use a "build-your-own" validator, all JMWE does is pass the Jira Expression to Jira, and Jira runs the expression on its own during validation. Therefore, if there is a problem during the evaluation, it can only be Jira's fault.
In this particular case, when you test the validator, is the Original Estimate supposed to change during the transition, or are you really testing the existing Original Estimate?
The Original Estimate value must be set during this transition and it must not be null or zero. I can get the workflow step to operate if the value is null (by requiring it to not be empty) but I cannot find a way to also prevent the user from supplying a value of "0". Thanks David.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I assume the script you used is the following?
issue.originalEstimate != null && issue.originalEstimate > 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.