Infos:
- Used Zammad version: 4.1.0-87
- Used Zammad installation type: docker-compose
- Operating system: centos
- Browser + version: 92.0.1 20210922161155
Expected behavior:
- picking the ticketstate (open/closed) e.g. offen/geschlossen should hide the window pending til
Actual behavior:
- Pending Til is mandatory even on a selection of open/closed
Steps to reproduce the behavior:
- opening a ticket and choosing the ticket closed/open state
Background:
I tried updating the environment to 5.0.1-3 but the zammad-init failed due to an invalid email. So I downgraded the system back to an old version to fix said email.
Edit:
Quick update:
I accessed the railsconsole following the guide in Working with ticket information — Zammad documentation
irb(main):026:0> attribute = ObjectManager::Attribute.get(object: 'Ticket',name: 'pending_time',)
=> #<ObjectManager::Attribute id: 7, object_lookup_id: 2, name: "pending_time", display: "Pending till", data_type: "datetime", data_option: {"future"=>true, "past"=>false, "diff"=>24, "null"=>true, "translate"=>true, "options"=>{}, "relation"=>"", "permission"=>["ticket.agent"]}, data_option_new: {}, 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, to_config: false, position: 41, created_by_id: 1, updated_by_id: 1, created_at: "2018-01-02 08:58:16", updated_at: "2021-10-12 11:18:30">
There is no required/shown_if set. Trying the commands:
>> attribute.data_option[:required_if][:state_id] = Ticket::State.by_category(:pending).pluck(:id)
>> attribute.data_option[:shown_if][:state_id] = Ticket::State.by_category(:pending).pluck(:id)
resulted into this error message:
irb(main):035:0> attribute.data_option[:required_if][:state_id]=Ticket::State.by_category(:pending).pluck(:id)
Traceback (most recent call last):
1: from (irb):35
NoMethodError (undefined method `[]=' for nil:NilClass)