Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JMWE field validation is not working

_Ekta Lala
January 13, 2026

Immaterial below condition is fatse or true, error msg is thrown. Can you help how to make it work. I am using this script in build your own validation to check current issue date is before than parent issue. 

 

let convertToNumber = x => x ? Number(x) : 0;
let convertToCalendarDate = x => x ? new CalendarDate(x) : null;
let convertToDate = x => x ? new Date(x) : null;
let convertCalendarDateToDate = x => x ? new Date(x.toISOString() + "T00:00:00") : null;
let convertDateToCalendarDate = x => x ? x.toCalendarDate() : null;

// Correct type check for RichText
//let convertRichText = x => x instanceof RichText ? x.plainText : x;
let convertRichText = x => typeof x == "RichText" ? x.plainText : x;

// Use issue.parent, not parent
let source = convertRichText(issue.customfield_11103);
let target = issue.parent != null ? convertRichText(issue.parent.customfield_11103) : null;

// Final comparison – make sure both sides are not null first, if needed:
source != null && target != null && source < target
//"source = " + source + ", target = " + target + ", comparison = " + (source <= target)

1 answer

Suggest an answer

Log in or Sign up to answer
1 vote
Marc -Devoteam-
Community Champion
January 13, 2026

HI @_Ekta Lala 

What is your goal.

What language is the script?

JMWE in cloud supports nunjucks language only, noy groovy?

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events