Hi
I have a problem with scripted validator - we do have some text custom field which has some default value assigned during creation of the issue (template) and when closing issue I want to check if default value (template) was modified.
Here is the validator which I use - it is working perfectly good when default value (template) is not complex (for example one sentence without enters)
if(!(issue.projectObject.key in ["TEST"])){
return true;
} else {
if((cfValues['Condition1']?.value in ['Done', 'N/A']) && (!(cfValues['Comment to C1'] in [null, '_Template_']))){
return true;
} else {
return false;
}}It is checking if project is TEST, then if Condition1 is set to "Done" or "N/A" and then it should check if field "Comment to C1" is not empty and is different than Template.
This is my Template which is used as default value of our text custom field:
_Please adapt this description field according to your needs._
_Examples:_ * first comment
* second comment
Do you have any hints how can I check if this field is not equal to this complex template?
Thanks in advance,
Paulina