123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- overview_role = Role.find_by(name: 'Agent')
- Overview.create_if_not_exists(
- name: 'My assigned Tickets',
- link: 'my_assigned',
- prio: 1000,
- role_ids: [overview_role.id],
- condition: {
- 'ticket.state_id' => {
- operator: 'is',
- value: Ticket::State.by_category(:open).pluck(:id),
- },
- 'ticket.owner_id' => {
- operator: 'is',
- pre_condition: 'current_user.id',
- },
- },
- order: {
- by: 'created_at',
- direction: 'ASC',
- },
- view: {
- d: %w[title customer group created_at],
- s: %w[title customer group created_at],
- m: %w[number title customer group created_at],
- view_mode_default: 's',
- },
- )
- Overview.create_if_not_exists(
- name: 'Unassigned & Open',
- link: 'all_unassigned',
- prio: 1010,
- role_ids: [overview_role.id],
- condition: {
- 'ticket.state_id' => {
- operator: 'is',
- value: Ticket::State.by_category(:work_on_all).pluck(:id),
- },
- 'ticket.owner_id' => {
- operator: 'is',
- pre_condition: 'not_set',
- },
- },
- order: {
- by: 'created_at',
- direction: 'ASC',
- },
- view: {
- d: %w[title customer group created_at],
- s: %w[title customer group created_at],
- m: %w[number title customer group created_at],
- view_mode_default: 's',
- },
- )
- Overview.create_if_not_exists(
- name: 'My pending reached Tickets',
- link: 'my_pending_reached',
- prio: 1020,
- role_ids: [overview_role.id],
- condition: {
- 'ticket.state_id' => {
- operator: 'is',
- value: Ticket::State.by_category(:pending_reminder).pluck(:id),
- },
- 'ticket.owner_id' => {
- operator: 'is',
- pre_condition: 'current_user.id',
- },
- 'ticket.pending_time' => {
- operator: 'within next (relative)',
- value: 0,
- range: 'minute',
- },
- },
- order: {
- by: 'created_at',
- direction: 'ASC',
- },
- view: {
- d: %w[title customer group created_at],
- s: %w[title customer group created_at],
- m: %w[number title customer group created_at],
- view_mode_default: 's',
- },
- )
- Overview.create_if_not_exists(
- name: 'Open',
- link: 'all_open',
- prio: 1030,
- role_ids: [overview_role.id],
- condition: {
- 'ticket.state_id' => {
- operator: 'is',
- value: Ticket::State.by_category(:work_on_all).pluck(:id),
- },
- },
- order: {
- by: 'created_at',
- direction: 'ASC',
- },
- view: {
- d: %w[title customer group state owner created_at],
- s: %w[title customer group state owner created_at],
- m: %w[number title customer group state owner created_at],
- view_mode_default: 's',
- },
- )
- Overview.create_if_not_exists(
- name: 'Pending reached',
- link: 'all_pending_reached',
- prio: 1040,
- role_ids: [overview_role.id],
- condition: {
- 'ticket.state_id' => {
- operator: 'is',
- value: Ticket::State.by_category(:pending_reminder).pluck(:id),
- },
- 'ticket.pending_time' => {
- operator: 'within next (relative)',
- value: 0,
- range: 'minute',
- },
- },
- order: {
- by: 'created_at',
- direction: 'ASC',
- },
- view: {
- d: %w[title customer group owner created_at],
- s: %w[title customer group owner created_at],
- m: %w[number title customer group owner created_at],
- view_mode_default: 's',
- },
- )
- Overview.create_if_not_exists(
- name: 'Escalated',
- link: 'all_escalated',
- prio: 1050,
- role_ids: [overview_role.id],
- condition: {
- 'ticket.escalation_at' => {
- operator: 'within next (relative)',
- value: '10',
- range: 'minute',
- },
- },
- order: {
- by: 'escalation_at',
- direction: 'ASC',
- },
- view: {
- d: %w[title customer group owner escalation_at],
- s: %w[title customer group owner escalation_at],
- m: %w[number title customer group owner escalation_at],
- view_mode_default: 's',
- },
- )
- Overview.create_if_not_exists(
- name: 'My replacement Tickets',
- link: 'my_replacement_tickets',
- prio: 1080,
- role_ids: [overview_role.id],
- out_of_office: true,
- condition: {
- 'ticket.state_id' => {
- operator: 'is',
- value: Ticket::State.by_category(:open).pluck(:id),
- },
- 'ticket.out_of_office_replacement_id' => {
- operator: 'is',
- pre_condition: 'current_user.id',
- },
- },
- order: {
- by: 'created_at',
- direction: 'DESC',
- },
- view: {
- d: %w[title customer group owner escalation_at],
- s: %w[title customer group owner escalation_at],
- m: %w[number title customer group owner escalation_at],
- view_mode_default: 's',
- },
- )
- overview_role = Role.find_by(name: 'Customer')
- Overview.create_if_not_exists(
- name: 'My Tickets',
- link: 'my_tickets',
- prio: 1100,
- role_ids: [overview_role.id],
- condition: {
- 'ticket.state_id' => {
- operator: 'is',
- value: Ticket::State.by_category(:viewable).pluck(:id),
- },
- 'ticket.customer_id' => {
- operator: 'is',
- pre_condition: 'current_user.id',
- },
- },
- order: {
- by: 'created_at',
- direction: 'DESC',
- },
- view: {
- d: %w[title customer state created_at],
- s: %w[number title state created_at],
- m: %w[number title state created_at],
- view_mode_default: 's',
- },
- )
- Overview.create_if_not_exists(
- name: 'My Organization Tickets',
- link: 'my_organization_tickets',
- prio: 1200,
- role_ids: [overview_role.id],
- organization_shared: true,
- condition: {
- 'ticket.state_id' => {
- operator: 'is',
- value: Ticket::State.by_category(:viewable).pluck(:id),
- },
- 'ticket.organization_id' => {
- operator: 'is',
- pre_condition: 'current_user.organization_id',
- },
- },
- order: {
- by: 'created_at',
- direction: 'DESC',
- },
- view: {
- d: %w[title customer state created_at],
- s: %w[number title customer state created_at],
- m: %w[number title customer state created_at],
- view_mode_default: 's',
- },
- )
|