JMWE Field Required Validator works wrong with comment field.

Alexey Mogilyovkin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 21, 2020

JMWE Field Required Validator should work exactly as default Jira one. But I've encountered a problem with Comment field.
What I want to do is to make Comment required if resolution has particular value. So I create validator, click "Conditional validation" and insert "issue.resolution != 'Done'" in Condition field.
But in logs I see expression:"!(issue.resolution.name != 'Done' && issue.comments.length >= 0) || !!issue.comments && issue.comments.length > 0"

Why condition "|| !!issue.comments && issue.comments.length > 0" is being added to my constraint? In this case validation is true if issue has at least one comment, not necessarily my. That is not how default Field Required Validator works. It doesn't check other comments, only the one that is being added.

What are solutions for the problem?

Screenshot from 2020-04-22 16-28-46.png.Screenshot from 2020-04-22 16-30-51.png

1 answer

0 votes
Radhika Vijji _Innovalog_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2020

Hi Alexey,

Conditions and Validators on the cloud are built on Jira expressions. So any condition or validator configuration is on whole represented as a single “Jira expression” (as shown in the logs). These are designed by Atlassian which currently are limited - https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables. We currently do not have the provision in Jira expressions to access the “transition” information. So the validator will consider the field values after the transition screen - what they can’t do is know what change was made on the transition screen.

Regards,

Radhika

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events