All eazyBI for Jira eazyBI for Confluence Private eazyBI

Calculated field examples (NEW)

You have two options for creating JavaScript calculated fields:

Defining these calculated fields requires knowledge about the Jira issue JSON structure, the JavaScript programming language, and both approaches available in eazyBI.

Account calculated fields (RENAMED) and Global calculated fields (RENAMED) share the same structure (settings) and JavaScript code. 

Examples with Count of votes

Calculated field to retrieve vote count for each issue. You can import this field as a property, as a dimension, and as a measure.

Account specific calcauted field:

Specify the settings for the new field. 

  • Internal name, e.g., votes         
  • Display name as you want to see it report, e.g.,Count of votes        
  • Data type select integer
  • select the Dimension checkbox
  • select the Measure checkbox
  • Add the additional advanced settings: json_fields = ["votes"] #this line is mandatory

JavaScript code:

if (issue.fields.votes) {
    return issue.fields.votes.votes;
}

Global calculated field

[jira.customfield_votes]
name = "Count of votes"
data_type = "integer"
dimension = true
measure = true
json_fields = ["votes"] #this line is mandatory
javascript_code = '''
if (issue.fields.votes) {
    return issue.fields.votes.votes;
}
'''

More JavaScript code examples: