ticket_states.rb 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Ticket::State.create_if_not_exists(
  2. id: 1,
  3. name: 'new',
  4. state_type_id: Ticket::StateType.find_by(name: 'new').id,
  5. default_create: true,
  6. )
  7. Ticket::State.create_if_not_exists(
  8. id: 2,
  9. name: 'open',
  10. state_type_id: Ticket::StateType.find_by(name: 'open').id,
  11. default_follow_up: true,
  12. )
  13. Ticket::State.create_if_not_exists(
  14. id: 3,
  15. name: 'pending reminder',
  16. state_type_id: Ticket::StateType.find_by(name: 'pending reminder').id,
  17. ignore_escalation: true,
  18. )
  19. Ticket::State.create_if_not_exists(
  20. id: 4,
  21. name: 'closed',
  22. state_type_id: Ticket::StateType.find_by(name: 'closed').id,
  23. ignore_escalation: true,
  24. )
  25. Ticket::State.create_if_not_exists(
  26. id: 5,
  27. name: 'merged',
  28. state_type_id: Ticket::StateType.find_by(name: 'merged').id,
  29. ignore_escalation: true,
  30. )
  31. Ticket::State.create_if_not_exists(
  32. id: 6,
  33. name: 'removed',
  34. state_type_id: Ticket::StateType.find_by(name: 'removed').id,
  35. active: false,
  36. ignore_escalation: true,
  37. )
  38. Ticket::State.create_if_not_exists(
  39. id: 7,
  40. name: 'pending close',
  41. state_type_id: Ticket::StateType.find_by(name: 'pending action').id,
  42. next_state_id: Ticket::State.by_category(:closed).first.id,
  43. ignore_escalation: true,
  44. )