projectAlertRule.ts 691 B

1234567891011121314151617181920212223242526272829
  1. import {IssueAlertRule} from 'sentry/types/alerts';
  2. export function ProjectAlertRule(params: Partial<IssueAlertRule> = {}): IssueAlertRule {
  3. return {
  4. id: '1',
  5. name: 'My alert rule',
  6. environment: 'staging',
  7. actionMatch: 'all',
  8. filterMatch: 'all',
  9. conditions: [
  10. {name: 'An alert is first seen', id: 'sentry.rules.conditions.1', label: ''},
  11. ],
  12. actions: [
  13. {
  14. name: 'Send a notification to all services',
  15. id: 'sentry.rules.actions.notify1',
  16. label: '',
  17. },
  18. ],
  19. filters: [],
  20. createdBy: null,
  21. dateCreated: '',
  22. projects: [],
  23. snooze: false,
  24. frequency: 1,
  25. status: 'active',
  26. ...params,
  27. };
  28. }