All eazyBI for Jira eazyBI for Confluence Private eazyBI

Previous status

Import the issue's previous status and use the measure "Issue Previous status" with "Issue" dimension members at the issue level. Or use the dimension "Previous status" to filter results by the issue's previous status.

Account-specific calculated field

Account specific calculated fields are defined in Source Data → Import options.

Settings for the new field

Internal name

prevst

Display namePrevious Status
Data type

string 

Dimension

Custom JavaScript code:

var pst;
if (issue.changelog && issue.changelog.histories && issue.changelog.histories.length > 0) {
  var histories = issue.changelog.histories;
  for (var i = histories.length - 1; i >= 0; i--) {
    var history = histories[i];
    if (history.items && history.items.length > 0) {
      for (var n = history.items.length - 1; n >= 0; n--) {
        var item = history.items[n];
        if (item.field == 'status') {
          pst = item.fromString;
            break; // Exit the inner loop
        }
      }
      if (pst) {
        break; // Exit the outer loop if a date has been found
      }
    }
  }
}
return pst;

Global calculated field

Global calculated fields are defined in eazyBI advanced settings.

Here are the settings for the new field definitions. You should insert the JavaScript (the code given above) below the line // Insert here the Custom JavaScript codeKeep the opening and closing quotation marks. ''', do not delete them.

#previous status
[jira.customfield_prevst]
name = "Previous Status"
data_type = "string"
dimension = true
javascript_code = '''
   // Insert here the Custom JavaScript code 
'''