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
</Link>
</Text>
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.
<Text>
[Open in issue navigator](/issues/?jql={myjql})
</Text>
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?