JavaScript Code

Hey Team,

I am looking to create Javascript custom field with type dimension for below requirements.

  1. A JavaScript Calculated custom field called ‘NBUX WorkStreams’ that is a specific subset of Jira field ‘Label’ on Epics. This may be called a Type dimension. Would be an aggregate of these values:
    ---- ‘Labels1’, ‘labels2’,‘etc’
  1. Similar to previous one, a JavaScript Calculated custom field called ‘NBU Eng Dirs’ that is a specific subset of Jira custom field ‘Dev Owner’ (User picker fields)on Epics. This may be called a Type dimension. Would be an aggregate of these values:
    ----- ‘Name1’,‘Name2’,‘ETC’
  1. A JavaScript Calculated custom field called ‘Must Have Eng’ that is either a single value subset of Jira field ‘Label’ on Epics OR a True/False field. So this should either return the value ‘MUST-HAVE-ENG’ or True for Epics that have this Label.
    – Value to match: ‘MUST-HAVE-ENG’

4.Similar to previous one, a JavaScript Calculated custom field called ‘High Priority’ that is either a single value subset of Jira field ‘Label’ on Epics OR a True/False field. So this should either return the value ‘HIGH-PRI’ or True for Epics that have this Label.
– Value to match: ‘HIGH-PRI’

Any suggestion regarding this…

//Rohit

Hi @rohit.mat!

Please see eazyBI documentation on how to create JavaScript calculated fields: JavaScript calculated custom fields.
You would define the field ID, name and data_type followed by the javascript_code in the eazyBI advanced settings:

[jira.customfield_nbux_workstreams]
name = "NBUX WorkStreams"
data_type = "text"
javascript_code = '''
// your code goes here
'''

Before defining the field, you can test the JS code in eazyBI Jira import options / Additional options as described.

See the following community post with an example of a custom dimension based on the Label field: Create dimension based on labels of jira tickets - #2 by janis.plume.

Lauma / support@eazybi.com