Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make email footer link from alerting rules match {{rule.url}} #151355

Closed
mikecote opened this issue Feb 15, 2023 · 1 comment · Fixed by #160196
Closed

Make email footer link from alerting rules match {{rule.url}} #151355

mikecote opened this issue Feb 15, 2023 · 1 comment · Fixed by #160196
Assignees
Labels
discuss Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@mikecote
Copy link
Contributor

After #148671 merges, the {{rule.url}} mustache variable can be customzied by the rule type to point to somewhere more contextual within an application. Should we match this behaviour with the email footer link? which is hardcoded to the rule details page of stack management at this time.

@mikecote mikecote added discuss Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework labels Feb 15, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@mikecote mikecote moved this from Awaiting Triage to Todo in AppEx: ResponseOps - Execution & Connectors Feb 16, 2023
mikecote added a commit that referenced this issue Feb 16, 2023
…148671)

Resolves: #145132.

In this PR, I'm adding a new function to the server-side rule type
definition called `viewInAppRelativeUrl`. This function returns a
relative path to view the rule in the proper application that will
provide more context. This relative path is used to build the `rule.url`
mustache variable for the actions (overriding the rule details page link
when defined) as well as a fallback for the UI's `View in App` button if
no navigation is registered on the front-end.

Follow up issues:
- #149608
- #151355

## ML to verify

1.  Create an anomaly detection rule from the ML application
2. Go to stack management rule details page
3. Click "View in App"
4. Ensure it brings you to the ML app properly.
5. Repeat step 1 to 4 in a space that isn't the default

Note: ML won't take advantage of the new functionality yet, but we plan
to help in a follow up #149608
so that ML anomaly detection rules can provide a view in app URL within
the rule action messages.

## ResponseOps to verify

1. Set `server.publicBaseUrl` to the proper value in your kibana.yml
6. Modify the [index threshold rule
type](https://github.com/elastic/kibana/blob/main/x-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts#L108-L136)
to have a `getViewInAppRelativeUrl` function returning
`/app/management/insightsAndAlerting/triggersActionsConnectors/connectors`.
7. Create an index threshold rule that always fires. Make sure to add a
a server log action that contains the `{{rule.url}}` variable.
8. Pull the printed URL from the server logs and make sure it works and
brings you to the connectors page.
9. Navigate to the rule details page, click the "View in App" button and
ensure it also brings you to the connectors page.
10. Create a Kibana space.
11. Go into that created space and repeat step 3 to 5. Ensure the URL
and View in App keep you in the same space.

---------

Co-authored-by: Kibana Machine <[email protected]>
@doakalexi doakalexi self-assigned this Jun 20, 2023
@doakalexi doakalexi moved this from Todo to In Progress in AppEx: ResponseOps - Execution & Connectors Jun 20, 2023
@ersin-erdal ersin-erdal self-assigned this Jun 21, 2023
@doakalexi doakalexi removed their assignment Jun 21, 2023
@ersin-erdal ersin-erdal moved this from In Progress to In Review in AppEx: ResponseOps - Execution & Connectors Jun 22, 2023
ersin-erdal added a commit that referenced this issue Jun 29, 2023
…tors (#160196)

Resolves: #151355

This PR intends to use `rule.url` (provided by the rule type) in the
email connector's footer link rather than the hardcoded path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants