Create custom field with properties from issue and parent epic

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

  1. FixVersions from Issue, if not set then
  2. Planned version from Issue, if not set then
  3. FixVersions from parent epic, if not set then
  4. Planned version from parent epic, if not set then
  5. 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?

Hi @mikes222 ,

eazyBI, by default, allows data to be analyzed based on the issue field values. The app also supports extending this and inheriting values from a specific level of the hierarchy during import. However, there are a couple of caveats for this in your case:

  1. The solution will set the parent’s values on children regardless of whether a child has a value in the field.
  2. There is no straightforward way to support the ‘if’ logic in your requirement.

While we have some ideas for future development to implement something like inherit_if_missing=true, currently, I suggest you consider using some scripted fields in Jira with more extended and complicated rules to specify when and which field values to inherit from epics. See some description about the scripted fields here: Jira calculated and scripted custom fields.

Lauma / support@eazybi.com