Cant Select the Components even after adding Custom JavaScript code

Good Afternoon,
I’m trying to Import Component/s as a Dimension because we need to be able to target Vulnerabilities by asset (Components).
But when I add custom JavaScript code in the Additional Options and I test the custom JavaScript code with an issue test and the Information appears.

But when I go back to the custom Field tab, i Still cant select it ??

[“MyJira”.customfield_components]
name = “Components”
data_type = “string”
dimension = true
multiple_values = true
split_by = “,”
javascript_code = “”

var components=issue.fields.components;
var result=[];

if (components) {
for (var i=0;i<components.length;i++)

{ result.push(components[i].name); }
issue.fields.customfield_components=result.join(",");
}
“”

What am I Missing here ?!?

h

Hi,

Quite recently we added a page dimension feature where you can use the same dimension in pages and in columns/rows
Perhaps, you can play around with “Project” dimension in your report where Component is one of the hierarchy levels in that dimension.

If you still need a separate dimension for Components, try this Javascript code in your eazyBI advanced settings .
And you don’t need to add custom code in Additional Options but in Advanced settings which is a different place in UI.

Note that only Jira system administrators or eazyBI admins can access advanced settings.

Try this code to define a new dimension for Components

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

After that, open eazyBI import options and find your new custom field “Components” under the custom_fields tab and select it to import as a separate dimension.

Martins / eazyBI support

Hi,

The very first row of your defintion seems to be wrong.
["MyJira".customfield_components]
It should be as in my example.

Try the code I shared in my previuos answer.
Martins / eazyBI support

1 Like

Thank you, @martins.vanags, for that code snippet. I tried to use it and all of my issues showed “(none)” in the new dimension even though they have components.

When I look at [Issue].CurrentHierarchyMember.AllProperties - I only see “Component IDs”:
component

My goal was to be able to combine “duplicate” components from different projects - but the text of the components isn’t available as far as I can tell.

Am I missing something? It looks like each ID would need to be mapped to text. Please advise.

Thank you…and happy holidays!

Hey @ABClark ,

Have you tried selecting the property measure “Issue components”?
There should be already a predefined measure in the “Measrues” dimension that would return all components for each issue.

Martins / eazyBI

Hi, @martins.vanags, thank you for your reply.

I did not make my need clear, my apologies. I actually found the answer I sought here: Grouping of components from multi projects - #2 by ilze.leite

I needed to filter through long lists of components from multiple projects to cull out all but a few. @ilze.leite’s solution worked like a dream for me. My gratitude to both of you!

I wish you a wonderful holiday with your families and friends! Thank you for all you do to make my job so much easier!

1 Like