How to navigate within a product?

I am trying to find a way to navigate from a Forge issue glance to the issue navigator within Jira and pass the JQL parameter: basically, go to /issues/?jql=${myjql}

Here are the things I have tried:

1. Use a button
I would have preferred to have a Forge UI button with link appearance, but I have not found any way to do this (there is no href prop and with onClick I guess access to window.location or similar is required.

2. Use Text element with format markup
Unfortunately, this approach renders an href pointing to https://issues/?jql=myjql and I am not sure how to get the base URL from the Jira instance in Forge.

<Text format="markup">
    <Link href={`/issues/?jql=${myjql}`}>
        Open in issue navigator

3. Use Text element with format markdown
This generally renders the URL correctly (including base URL) but fails because it seems you cannot use template strings when using Markdown format.

    [Open in issue navigator](/issues/?jql={myjql})

The only way I can think of right now is to fetch GET /rest/api/3/serverInfo which returns the base URL, then assemble the URL and using method 2 - but this feels overkill.

Does anyone know any way to navigate within the product from a Forge app or to get the instance base URL?

Hi @tbinna,

Thanks for bringing this up. Your example for format="markup" should work, but it looks like we’ve recently introduced a regression. Sorry about that!

While we work on fixing that up, you should be able to use markdown format with template strings like so:

  const issueKey = 'ISSU-234';
  return <Text format="markdown" content={`[hey](/browse/${issueKey})`} />;

Thanks, @RyanBraganza, that works indeed and is one permutation that I have not tried yet :+1:

Good to know that it should work with markup too.

Is there a way to open the link in a new tab using markdown?

What would need to be added here?
<Text format=“markdown” content={[hey](/browse/${issueKey})} />

Hi @MatthewEbert, sorry for missing your reply. We don’t support markdown anymore but we are working on a solution to navigate to an external page in a new tab in UI Kit.

Hi @nhur is there any update on this? I can’t find anything in documentation about creating issue url and navigating to it.