I am using showFlag in a forge cloud jira app and it was working but when I update the the Jira to the new UI navigation,it is not working
Hi @OmarReda1, we haven’t been able to reproduce this yet so will need some more details on the behaviour.
Do you have a code snippet on how you’re calling showFlag
? Is it specifically broken only when you toggle to the new UI navigation and works when you toggle the UI back, without any code changes to your app?
What module is your app using? And is this a UI Kit or Custom UI app?
Hello @PeterYu
We are using Custom UI App.
Also After some investigations I realised it sometimes happen also with the old UI not only on UI navigations.
There is also this error in the logs :
Feature flags are not available yet. The feature flag client can’t be initialized.
current code :
import { showFlag } from "@forge/bridge";
import { FlagAppearance } from "@forge/bridge/out/flag/flag";
export const flag = (
title = "",
type = 'success' as FlagAppearance,
description = "",
actions: any = [],
id?: any
) => {
showFlag({
id: id ?? new Date(),
title: title,
type: type ?? 'success' ,
description: description,
actions: actions,
isAutoDismiss: true,
});
};
@OmarReda1
The id
property must always be defined and it must be a string
. Can you ensure that id
is defined and get rid of the Date
constructor? Or at least convert the Date
to a string
before assigning it as the id?
If that doesn’t work, try getting rid of some of the optional properties to see if you can get a flag rendering with just the bare minimum number of options. Are you doing type-checking on actions
so that each action fits the FlagAction
type described here?
interface FlagAction {
text: string;
onClick: () => void;
}