I would like to create a custom field with the version of the issue. Unfortunately there are 4 possible sources for this field. So I want
- FixVersions from Issue, if not set then
- Planned version from Issue, if not set then
- FixVersions from parent epic, if not set then
- Planned version from parent epic, if not set then
- null (or empty string)
I managed to create 2 custom fields with the following content:
if (issue.fields.fixVersions[0]) {
return issue.fields.fixVersions;
}
if (issue.fields.customfield_29801 && issue.fields.customfield_29801[0]) {
// planned for version
return issue.fields.customfield_29801;
}
return ""
One for the issue itself and one for the parent issue with the advanced setting
update_from_issue_key = "epic_key"
Afterwards I managed to create a Measure by combining them:
Case
WHEN [Issue].CurrentHierarchyMember.get("Fix or planned for version") <> "(none)"
THEN [Issue].CurrentHierarchyMember.get("Fix or planned for version")
ELSE
CASE
WHEN [Issue].CurrentHierarchyMember.get("Epic fix or planned for version") <> "(none)"
THEN [Issue].CurrentHierarchyMember.get("Epic fix or planned for version")
ELSE ""
END
END
Unfortunately I cannot use this Measure for Page filtering so I would like to combine all 3 scripts into one custom field. Is this possible and how?