oncall-engine/docs/sources
Nick Moore cf589d45c6
feat: add timedeltaparse function to the jinja template (#5142)
# What this PR does
If an OnCall template needs to contain a date relative to a date in the
alert response, currently there is no way for the template to add or
subtract time from a parsed date.

This PR adds a function that allows a time-window (e.g., 1s, 5m, 6h, 7d,
2w) to be converted into a Python timedelta, which can then be added or
subtracted from a datetime. An example usage might be:

```
{% set delta = alert.timeWindow | timedeltaparse %}
{% set time = alert.startsAt | iso8601_to_time - delta | datetimeformat('%s') %}
```

## Checklist

- [X] Unit, integration, and e2e (if applicable) tests updated
- [X] Documentation added (or `pr:no public docs` PR label added if not
required)
- [X] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will show up in the
autogenerated release notes.
2024-10-09 18:27:48 +00:00
..
configure feat: add timedeltaparse function to the jinja template (#5142) 2024-10-09 18:27:48 +00:00
intro Replace docs/reference shortcode with ref URIs (#4301) 2024-07-29 14:13:24 +00:00
manage docs: update notifications wording (#5030) 2024-09-27 06:19:46 +00:00
mobile-app fix information architecture for mobile app docs (#3963) 2024-02-27 15:04:54 -05:00
oncall-api-reference Add latest alert to public api alert groups endpoint (#5059) 2024-10-02 17:09:50 +00:00
set-up docs: unified slack (#4844) 2024-08-22 07:58:26 +00:00
_index.md update docs landing page (#4116) 2024-04-03 15:24:56 +00:00