Help displaying Component Name

#1

Hello,

I am trying to create a new user defined calculated measure that will display the Component name for each issue listed in my rows.

Is there a calculation I can use that will show the component name? I think this might be harder for me since it is part of project.

Thanks.

#2

I tried using in the calculated measure:

[Project].[Component].CurrenthierarchyMember.Name

but that only returns the name of the project, not the components.

Does anyone know how I can take this a step further and get the component name?

Thanks.

#3

Hi,

The component is a multi-selection field in Jira, and each issue may have more than one.
To get related components to the issue, you may use function Generate() and iterate through all components which are related to issue. A formula may look like this:

Generate(
  -- iterate through all components
  Filter(
    [Project].[Component].Members,
    [Measures].[Issues created] > 0),
  -- retun a listo of issue related components separated by comma
  [Project].CurrentMember.Name,
  ', ')

Another approach is to import Component as issue property in eazyBI. To do this, you may define Component as JavaScript calculated custom field.
In eazyBI advanced settings, copy in this definition with JavaScript to fetch issue component.

[jira.customfield_eazybicomponent]
name = "Component"
data_type = "string"
multiple_values = true
split_by = ","
javascript_code = '''
issue.fields.customfield_eazybicomponent = issue.fields.components;
'''

Then in import options, select custom field Component to import as property. And import data.

Best,
Zane / support@eazyBI.com

#4

Thank you Zane, the function worked perfectly.

#5

can this be used for all the multi-select fields ?

#6

HI. Im trying to do the same thing. I did the following but cant find ‘component’ after i re-import?

#7

Hi @kleinj3,

I understand that you have JavaScript to import component as issue property and represent it for each issues. Data re-import does not change selected projects and custom fields in eazyBI import options, but sometimes users deselect some of the custom fields. Go to import options, tab Custom fields, and check whether “Component” is selected for data import.
When Component is imported as issue property, you will find it in Measures -> Issue properties -> Issue Component.

Best,
Zane / support@eazyBI.com

#8

I tried this as well and received an error

Execution of custom JavaScript code raised the following error:
unterminated string literal

#9

Hi @jeffb,
From the screenshot, I see that code is missing the last line with the symbols marking the end of JavaScript part:

'''

Add the missing line or copy the whole code example from this conversation.

Best,
Zane / support@eazyBI.com