Multiple pinned search tabs, or even folders users can create themselves

Hey @chesty,

i wrote a small how to for another community member. So the below is just copy+paste from that but it should work:

it actually is pretty simple. @martini helped us with this tho.
This is what we did on our system to create a new pending state:

On your zammad server open the rails console

zammad run rails c

Add the new ticket state

Ticket::State.create_or_update(
name: ‘CHANGEME’,
state_type_id: Ticket::StateType.find_by(name: ‘pending reminder’).id,
ignore_escalation: true,
created_by_id: 1,
updated_by_id: 1,
)

Make the new state selectable

ObjectManager::Attribute.add(
force: true,
object: ‘Ticket’,
name: ‘state_id’,
display: ‘State’,
data_type: ‘select’,
data_option: {
relation: ‘TicketState’,
nulloption: true,
multiple: false,
null: false,
default: Ticket::State.find_by(default_follow_up: true).id,
translate: true,
filter: Ticket::State.by_category(:viewable).pluck(:id),
},
editable: false,
active: true,
screens: {
create_middle: {
‘ticket.agent’ => {
null: false,
item_class: ‘column’,
filter: Ticket::State.by_category(:viewable_agent_new).pluck(:id),
},
‘ticket.customer’ => {
item_class: ‘column’,
nulloption: false,
null: true,
filter: Ticket::State.by_category(:viewable_customer_new).pluck(:id),
default: Ticket::State.find_by(default_create: true).id,
},
},
edit: {
‘ticket.agent’ => {
nulloption: false,
null: false,
filter: Ticket::State.by_category(:viewable_agent_edit).pluck(:id),
},
‘ticket.customer’ => {
nulloption: false,
null: true,
filter: Ticket::State.by_category(:viewable_customer_edit).pluck(:id),
default: Ticket::State.find_by(default_follow_up: true).id,
},
},
},
to_create: false,
to_migrate: false,
to_delete: false,
position: 40,
)

Add a depending date field

ObjectManager::Attribute.add(
force: true,
object: ‘Ticket’,
name: ‘pending_time’,
display: ‘Pending till’,
data_type: ‘datetime’,
data_option: {
future: true,
past: false,
diff: 24,
null: true,
translate: true,
required_if: {
state_id: Ticket::State.by_category(:pending).pluck(:id),
},
shown_if: {
state_id: Ticket::State.by_category(:pending).pluck(:id),
},
},
editable: false,
active: true,
screens: {
create_middle: {
‘-all-’ => {
null: false,
item_class: ‘column’,
},
},
edit: {
‘-all-’ => {
null: false,
},
},
},
to_create: false,
to_migrate: false,
to_delete: false,
position: 41,
)

This is all we did. Run each command block one by one or all at once (keep the order!).

If you want to create a new state without a pending time you have to alter the commands, have a look at this f. e. :
https://docs.zammad.org/en/latest/api-ticket-state.html

cheers

1 Like