Get issuelinks as customfield using java script

Hi,

i’m trying to get the “issuelinks” as custom field and I didn’t succeed.

I’m using the following code:
var customfield_RDissuelinked; if (issue.fields.issuelinks && issue.fields.issuelinks.length > 0) { var issuelinks = issue.fields.issuelinks; for (var i = 0; i < issuelinks.length; i++) { var issuelinked = issuelinks[i]; if (issuelinked.type) { if (issuelinked.type == 'is caused by') {customfield_RDissuelinked = issuelinked.inwardIssue.key;} } } }

and I have the following fields structure in the ticket:

could you please help?

thanks
alexandre

Hi @anitu!

There is no need for a JavaScript field when defining the Issue link (Import issue links - eazyBI for Jira). You should be able to do it with the following advanced settings

[jira.customfield_RDissuelinked]
name = "RD Issues"
inward_link = "is caused by"
dimension = true
multiple_values = true

Let me know if I missed something and you have some further questions!
Lauma / support@eazybi.com

Hi Lauma,

This works very well!
Many thanks for!

alexandre

1 Like

Hello Lauma,

I have another question on the same topic, but If I have to raise it in a separate message please let me know and I’ll do it.

I would need to get more info from the linked issue, such as the priority and the product, like in the attached picture.

On the left side I have the outward issue and on the right side the linked issue caused by the issue on the left side.
I would like to be able to get the following values:

  • the priority on the left side - “name” : “Highest”
  • the labels values and the “customfield_11134” - “value”: “TITAN LIVE” from the right side.

Is that possible?

thank you
alexandre

Hi @anitu!

You can inherit the values from the linked fields, see Issue link field dimensions - eazyBI for Jira.
Here is also an example of how to inherit values from a single value custom field: Request for Javascript example - #2 by janis.plume.

Let me know if that helped or if you have further questions regarding this!
Lauma / support@eazybi.com

Hi Lauma,

Thank you for your answer.
I have tried to use the “Issue link field dimensions” but I have to to admit that I do not see what value to set for issue_id_column = “epic_id”, what should be the “epic_id”.

thanks
alexandre

@anitu,

Please take a look at this last example with the Feature label: Issue link field dimensions - eazyBI for Jira.
Once you have a link dimension specified, you can use it’s id in the definition. From what we discussed here, it would be similar to this:

[jira.customfield_RDissuelinked]
name = "RD Issues"
inward_link = "is caused by"
dimension = true
update_from_issue_key = "parent_issue_key"

[[jira.issue_link_field_dimensions]]
name = "RD Issues Priority"
source_dimension = "Priority"
issue_key_column = "customfield_RDissuelinked"
group = "Linked issue dimensions"

Lauma / support@eazybi.com