I’m trying to extend the solution proposed in https://community.eazybi.com/t/filter-open-issue-by-summary/6046 to create a calculated custom field to show how many times epics have been split.
When an epic moves from one planning increment to another it is split into two. An epic with the summary: “my big epic” becomes “my big epic (Split Part 1)” and “my big epic (Split Part 2)”. It is possible that if an epic moves to a third planning increment it could branch into a third epic “my big epic (Split Part 3)” and so on
I can use
javascript_code = '''
var result;
if (issue.fields.summary && issue.fields.summary.match(/.*Split Part.*/)) { result = true;}
else {
result = false;
}
issue.fields.customfield_split_epic = result;
'''
to capture the epics that have been split but I’d like to capture the split number …1, 2, or 3 etc
I’ve tried
javascript_code = '''
var result;
var split;
result = "";
split = issue.fields.summary && issue.fields.summary.match((?<=Split Part ).)
switch(split) {
case "1":
result = "Split to future qtr";
break;
case "2":
result = "Split from previous qtr";
break;
case "3":
result = "Split from previous qtr x 2";
break;
issue.fields.customfield_JA_split_epic = result
}
'''
but my syntax is a bit off, obviously
Thanks
Paul