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)
HI @_Ekta Lala
What is your goal.
What language is the script?
JMWE in cloud supports nunjucks language only, noy groovy?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.