Workflow Validator - Require comment when field is filled

Hans-Hermann Hunfeld January 11, 2017

Hi there,

we need to set comment to mandatory when the field "Flagged" is marked. Tried this based on the current groovy documentation, but this is not working as the variable is not declared...

cfValues['Flagged'] || transientVars["comment"]

image2017-1-11 15:41:2.png

Maybe not a big thing, but how to solve?

Best regards,

Hans-Hermann

2 answers

0 votes
Hans-Hermann Hunfeld January 17, 2017

Hi Jamie,

thanks for the update, but it seems that it´s not working. I could transition an issue with field "Flagged" being marked but added no comment, JIRA accepted it and updated the status. My expectation was to being blocked until a comment was added.

Did i configure something wrong?

Thanks & best regards,

Hans-Hermann

JamieA
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.
January 17, 2017

Well you are saying "Flagged" OR "with a comment". Do you want to say if it's flagged it must have a comment? Do you want the comment to be required when the issue is first flagged, or every transition thereafter?

Hans-Hermann Hunfeld January 17, 2017

The transitions should be blocked in case the field "Flagged" is marked during this transition and no comment was added (as explanation why the flag has been set).

0 votes
JamieA
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.
January 17, 2017

cfValues is only available in Simple Scripted Validator IIRC. That said there seems to be a bug in the type-checking. It's marked as an error but works fine: https://productsupport.adaptavist.com/browse/SRJIRA-2101

Suggest an answer

Log in or Sign up to answer