Custom object does not work like owner_id

Infos:

  • Used Zammad version: 6.2.0-1709709730.4ab26fc3.jammy
  • Used Zammad installation type: (source, package, docker-compose, …) source
  • Operating system: Ubuntu 22.04.4 LTS
  • Browser + version: any

Expected behavior:

I’m creating the following object in Zammad:

mitarbeiter_attr = ObjectManager::Attribute.create!(
object_lookup_id: 1,
name: “mitarbeiter”,
display: “Mitarbeiter”,
data_type: “select”,
data_option: {
“default” => “”,
“relation” => “User”,
“relation_condition” => { “roles” => “Agent” },
“nulloption” => true,
“multiple” => false,
“null” => true,
“translate” => false,
“permission” => [“ticket.agent”],
“maxlength” => 255
},
data_option_new: {},
editable: false,
active: true,
screens: {
“create_middle” => { “-all-” => { “null” => true, “item_class” => “column” } },
“edit” => { “-all-” => { “null” => true } }
},
to_create: false,
to_migrate: false,
to_delete: false,
to_config: false,
position: 31,
created_by_id: 1,
updated_by_id: 1
)

It is supposed to behave exactly like owner_id. That object looks like this:

[3] pry(main)> attr = ObjectManager::Attribute.find_by(name: ‘owner_id’)
=> #<ObjectManager::Attribute:0x00007d61263f71b8
id: 7,
object_lookup_id: 1,
name: “owner_id”,
display: “Owner”,
data_type: “select”,
data_option: {
“default” => “”,
“relation” => “User”,
“relation_condition” => { “roles” => “Agent” },
“nulloption” => true,
“multiple” => false,
“null” => true,
“translate” => false,
“permission” => [“ticket.agent”],
“maxlength” => 255
},
data_option_new: {},
editable: false,
active: true,
screens: {
“create_middle” => { “-all-” => { “null” => true, “item_class” => “column” } },
“edit” => { “-all-” => { “null” => true } }
},
to_create: false,
to_migrate: false,
to_delete: false,
to_config: false,
position: 30,
created_by_id: 1,
updated_by_id: 1,
created_at: Thu, 04 Apr 2024 11:56:35.924000000 UTC +00:00,
updated_at: Thu, 04 Apr 2024 11:56:35.924000000 UTC +00:00

Actual behavior:

  1. When I select a user and update the ticket, the mitarbeiter field is reset to empty afterward.
  2. When I try to create an overview based on owner_id, it works.
    (Filter condition: Owner → is → current user)
    But when I try the same with mitarbeiter, I only get the message:
    “Invalid conditions for object selection.”

Steps to reproduce the behavior:

Create object via the rails console and try to change it in the Ticket or try to create an overview based on it.

1 Like

Of course not, what you’re trying to achieve is not supported by Zammad.

1 Like

This topic was automatically closed 360 days after the last reply. New replies are no longer allowed.