How to get Max Affected version at the feature level

Hi - My affected version has multiple related versions (1.5, 1.6, 1.7 etc) and I would like to create a calculated member or measure that would bring back the maximum one by name. Unfortunately, this info is embedded under projects and other hierarchies. I’ve failed on several attempts at doing this with affected version in rows.

Thx

Hi @Tjones,

Welcome to the eazyBI community. A calculated member in the Measures dimension for this kind of calculation would be pretty heavy - it would have to go through all issues that have values in the field and then generate and order a set of these values. I would advise trying a JavaScript calculated custom field that will calculate these values during the import.

You can define a JavaScript calculated custom field in the eazyBI advanced settings. Please have a look at the documentation page for more information on this - https://docs.eazybi.com/eazybijira/data-import/custom-fields/javascript-calculated-custom-fields.

Please add these parameters to the eazyBI advanced settings:

[jira.customfield_latest_aversion]
name = "Latest Affects Version"
data_type = "string"
dimension = true
javascript_code = '''
var versionList = [];
if (issue.fields.versions ) {
for (var i=0; i < issue.fields.versions.length; i++) {
  var versionName = issue.fields.versions[i].name;
  versionList.push(versionName);
}
}

if (versionList){
  versionList.reverse();
  issue.fields.customfield_latest_aversion = versionList[0];
}
'''

After that, please head to the eazyBI import settings and select the custom field “Latest Affects version” for import as a dimension and property.

Finally, you can use the dimension on rows to display the count of issues that have this version as the maximum one.

Kind regards,
Roberts // eazyBI support