projectAlertRule.ts 762 B

12345678910111213141516171819202122232425262728293031
  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. {
  11. id: 'sentry.rules.conditions.first_seen_event.FirstSeenEventCondition',
  12. name: 'A new issue is created',
  13. },
  14. ],
  15. actions: [
  16. {
  17. id: 'sentry.rules.actions.notify_event.NotifyEventAction',
  18. name: 'Send a notification (for all legacy integrations)',
  19. },
  20. ],
  21. filters: [],
  22. createdBy: null,
  23. dateCreated: '',
  24. projects: [],
  25. snooze: false,
  26. frequency: 1,
  27. status: 'active',
  28. ...params,
  29. };
  30. }