However, it appears that the ML job ID is not stored as a saved object reference, it is stored within the panel JSON itself.
Kibana will let you copy the dashboard into another space, and the dashboard will be broken because the job doesn't exist there.
This isn't a great UX, we should put some guard rails around this.
Steps to reproduce:
Start Kibana and log in
Navigate to Home, then add sample data
Navigate to Machine Learning, then create a new anomaly detection job
Navigate to Stack Management -> Spaces, then create a new space
Navigate to Stack Management -> Saved Objects, then copy the dashboard to the new space
Enter the new space
Navigate to the newly copied dashboard and observe that it is broken
Expected behavior:
We could detect when the user is attempting to export or copy a dashboard that contains an ML embeddable. In that case we could warn the user, or (in the case of copy) offer for the user to share the ML job to the destination space(s).
In the future, when dashboards are shareable, we could prompt the user to share the entire dashboard instead of copying it.
Kibana version:
Tested in latest
main
(8.2)Describe the bug:
You can add ML embeddables to a dashboard:
However, it appears that the ML job ID is not stored as a saved object reference, it is stored within the panel JSON itself. Kibana will let you copy the dashboard into another space, and the dashboard will be broken because the job doesn't exist there. This isn't a great UX, we should put some guard rails around this.
Steps to reproduce:
Expected behavior:
We could detect when the user is attempting to export or copy a dashboard that contains an ML embeddable. In that case we could warn the user, or (in the case of copy) offer for the user to share the ML job to the destination space(s). In the future, when dashboards are shareable, we could prompt the user to share the entire dashboard instead of copying it.
Screenshots (if relevant):