# Custom URL not directing to correct ML job in Anomaly Explorer from email alert

**URL:** <https://discuss.elastic.co/t/custom-url-not-directing-to-correct-ml-job-in-anomaly-explorer-from-email-alert/342763>\
**Category:** Kibana\
**Tags:** elastic-stack-machine-learning, elastic-stack-alerting\
**Created:** [September 11, 2023, 9:09pm UTC](https://discuss.elastic.co/t/custom-url-not-directing-to-correct-ml-job-in-anomaly-explorer-from-email-alert/342763 "2023-09-11T21:09:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emi\_rose](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emi_rose/32/83050_2.png) [@emi\_rose](https://discuss.elastic.co/u/emi_rose)\
**Post date:** [September 11, 2023, 9:09pm UTC](https://discuss.elastic.co/t/custom-url-not-directing-to-correct-ml-job-in-anomaly-explorer-from-email-alert/342763/1 "2023-09-11T21:09:07Z")

</div>

Hello,

I generated a few rules to alert on a severity threshold for different Anomaly Detection jobs. Whenever I click the url to open the job in anomaly explorer, it takes me to the same unrelated ML job. I'm using ({{{kibanaBaseUrl}}}{{{context.anomalyExplorerUrl}}}) in my email configuration. What might the reason be that all of my alerts are getting directed to the same ML job?

Thanks

---

<div class="post-metadata">

**Author:** ![wei.wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wei.wang/32/51803_2.png) [@wei.wang](https://discuss.elastic.co/u/wei.wang)\
**Post date:** [September 11, 2023, 11:32pm UTC](https://discuss.elastic.co/t/custom-url-not-directing-to-correct-ml-job-in-anomaly-explorer-from-email-alert/342763/2 "2023-09-11T23:32:58Z")

</div>

Hi,

Were your ml jobs created in [custom spaces](https://www.elastic.co/guide/en/kibana/current/xpack-spaces.html) other than default?

If yes, you might hit [this known issue](https://github.com/elastic/kibana/issues/160762), which was fixed in 8.9 version. If upgrade is not an option, the workaround is to add a URL path component that contains space info between the `kibanaBaseUrl` and `context.anomalyExplorerUrl`, e.g.

```auto
[Open in Anomaly Explorer]({{{kibanaBaseUrl}}}/s/my-custom-space{{{context.anomalyExplorerUrl}}})

```

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 9, 2023, 11:33pm UTC](https://discuss.elastic.co/t/custom-url-not-directing-to-correct-ml-job-in-anomaly-explorer-from-email-alert/342763/3 "2023-10-09T23:33:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
