I want to display a work-item-list in my Forge Jira app’s Custom UI frontend. Ideally, I’d re-use existing solutions to achieve this, instead of building it myself.
For that, I’m looking into Smart Links aka. Smart Cards, because that is what Jira itself does when pasting a URL of a work-item search result page (i.e. https://SITENAME.atlassian.net/issues/?jql=...
) to a rich-text field: It displays a dynamic table of the found work-items. I want that, or something similar to that.
I found example code for @atlaskit/smart-card and tried it in my Forge app:
import { CardClient, SmartCardProvider } from '@atlaskit/link-provider';
import { Card } from '@atlaskit/smart-card';
const issueSearchUrl = `https://my-site.atlassian.net/issues/?jql=statuscategory IN ("In Progress"%2C New)`;
<SmartCardProvider client={new CardClient('staging')}>
<Card appearance="block" url={issueSearchUrl} />
</SmartCardProvider>
→ It does compile and run, but doesn’t find any work-items (although there definitely are some):
I figured it has to do with (missing) authentication. I compared the network calls from my Forge app with standard Jira, and see that standard Jira calls include Cookie
headers, whereas requests in my Forge apps has neither Cookie
nor any Authentication
headers, so I think the requests are done anonymously and therefore find no work-items. This is in contrast to Forge Bridge’s requestJira()
, which manages to add Authentication
headers.
Anybody managed to make this work with Forge Custom UI, and can help?
I already played with CardClient’s baseUrlOverride, like so: new CardClient(env, "https://api.atlassian.net/gateway/api")
. Not sure if that would help.