Cannot use Priority.find({id})

Infos:

  • Used Zammad version: 2.6.x
  • Used Zammad installation source: package
  • Operating system: CentOS Linux release 7.5.1804 (Core)
  • Browser + version: Google Chrome Version 69.0.3497.81

Expected behavior:

Starting the Ruby Console from terminal:

zammad run rails c

Changing the Priority Names:

priority2 = Priority.find(2)
priority2.name = ‘2-high’
priority2.default_create = true
priority2.save!

Actual behavior:

Starting the Ruby Console from terminal:

zammad run rails c

Entering:

priority2 = Priority.find(2)

Receiving Error:

Loading production environment (Rails 5.1.5)
irb(main):001:0> priority2 = Priority.find(2)
NameError: uninitialized constant Priority
from (irb):1
irb(main):002:0>

Steps to reproduce the behavior:

Same as described

Thanks for posting, that’s an error on the documentation!

You’re searching for

priority2 = Ticket::Priority.find(2)

I’ve already updated the documentation, the change should be online within the next minutes.

1 Like

Thank you very much, tested and working.

In this regards i also tested changing the Priority Label with the REST API as documented at
https://docs.zammad.org/en/latest/api-ticket-priority.html#update

I received an success code but the “Object” did not update. Does it take a while, did i do something wrong, is there a bug?

/api/v1/ticket_priorities/3

Body

{
"id": 3,
"name": "3 low",
"default_create": true,
"note": "",
"active": true,
}

Return Code:

200 OK / 430.70 ms

(Or should i open another topic?)

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