Help displaying Component Name

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.

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.

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

Thank you Zane, the function worked perfectly.

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

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

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

I tried this as well and received an error

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

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

Thanks for the update: When I try that I get the following error: “Execution of custom JavaScript code raised the following error:
missing ; before statement”

[jira.customfield_eazybicomponent]
name = “Component”
data_type = “string”
multiple_values = true
split_by = “,”
javascript_code = ‘’‘issue.fields.customfield_eazybicomponent = issue.fields.components;’’’

Now the code looks right. Might be that the right formatting for the quotes is lost with copy paste, but otherwise than that the code is correct.

If you still have the same problem adding the code to import Component, please contact support@eazyBI.com and send them the whole advanced settings of your eazyBI environment.

Zane / support@eazyBI.com

Hi @zane.baranovska,
Your code worked perfectly for me to bring the components as a property of an issue. Is it possible to get the components as a dimension? We use the same components across all of our projects and I’d like to summarize data by those components.
Thanks!
Laurie

Actually @zane.baranovska,
I found it as a hierarchy level under the project dimension. I think that will do the trick!
Thanks again for your earlier post.
Laurie

Hi @lececere,

Yes, Component is a separate hierarchy level in the Project dimension. If you do not have similar components across projects, then this solution works perfectly.

However, if you have the same components in several projects, then you may import Component also as a separate dimension using the same JavaScript code. In that case, add one more line to the advanced settings dimension = true to enable custom field import also as a dimension.

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

You may check out a similar topic here: Cant Select the Components even after adding Custom JavaScript code

With this version 6.1 eazyBI has additional set of default properties Issue Components, Issue Sprints, Issue Fix versions, Issue Affects Version etc.).

Please see a list of all changes in changelog.

Daina / support@eazybi.com

1 Like

Hi @daina.tupule I can still not find component as a dimension on Eazybi

Hi @Rohan_Singh,

Since eazyBI version 6.1, the Component is imported as issue property by default but not as a separate dimension (Jira Core measures and dimensions).

If you would like to group of filter data by component, you have two options

  1. Use the “Project” dimension and use the Component level
  2. create a new calculated field to import component as separate dimension as described in this topic:

Since eayBI version 6.6 and on Cloud, there is an option to create calculated fields in the account import options (without disturbing the Jira system administrator or eazyBI admin).

Now you can create a Component dimension in import options → tab Custom fields.

For more details and the example please see the documentation here: New calculated fields

Best,
Zane /support@eazyBI.com