projectAlertRule.ts 669 B

12345678910111213141516171819202122232425262728
  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. ...params,
  26. };
  27. }