Dashboard Widget: Get dashboard id
Hello,
Is there a way for a widget to determine the ID of the dashboard on which it is currently displayed?
I want to synchronize multiple widgets on the same dashboard, for example charts and issue tables, and control them through a shared filter widget. I already have the synchronization working, but the selected filter is currently shared across all dashboards that contain these widgets.
I therefore need the current dashboard ID so that I can include it in the host.storage key and keep the stored filter settings isolated for each dashboard.
Is there a supported way to retrieve the current dashboard ID from within a widget?
Best regards
Please sign in to leave a comment.
Hi Jacqueline,
I'm Stan from the YouTrack Team. Thanks for reaching out!
There's currently no supported way to retrieve the dashboard ID from within a widget. The Host API doesn't expose the dashboard as an entity, and
YTApp.widget.idstays the same for a widget regardless of which dashboard it's placed on, so it can't be used as a substitute either.As I can see, you have already submitted a feature request, JT-97212, which asks for a stable dashboard identifier exposed through the Host API. While we can't promise it'd be put on the road map right away, we'll be sure to guide users with similar requests to vote for the issue. Voting helps us gauge the impact of features on YouTrack users.
Please don't hesitate to reach out anytime if you have any questions or need any help!