Add new ticket state(Waiting for client state)?

Infos:

  • Used Zammad version: 6.0.0
  • Used Zammad installation type: docker-compose
  • Operating system: ubuntu 22.04

Hi,
when i try to add status to ticket

Ticket::State.create_or_update(
  name: 'customer feedback',
  state_type_id: Ticket::StateType.find_by(name: 'open').id,
  ignore_escalation: true,
  created_by_id: 1,
  updated_by_id: 1,
)

i get the following error

/usr/local/bundle/gems/railties-6.1.7.4/lib/rails/railtie/configuration.rb:97:in `method_missing': undefined method `db_case_sensitive' for #<Rails::Application::Configuration:0x00007f8447bfa180 @root=#<Pathname:/opt/zammad>, @generators=#<Rails::Configuration::Generators:0x00007f8449632ac0 @aliases={}, @options={:rails=>{:orm=>:active_record, :test_framework=>:rspec, :integration_tool=>:test_unit, :system_tests=>:test_unit}, :active_record=>{:migration=>true, :timestamps=>true}, :test_unit=>{:fixture=>true, :fixture_replacement=>nil}}, @fallbacks={}, @templates=["/opt/zammad/lib/templates"], @colorize_logging=true, @api_only=false, @hidden_namespaces=[], @after_generate_callbacks=[]>, @middleware=#<ActionDispatch::MiddlewareStack:0x00007f8448053a38 @middlewares=[ActionDispatch::HostAuthorization, Rack::Sendfile, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::ActionableExceptions, ActionDispatch::Callbacks, ActionDispatch::Cookies, ActionDispatch::Session::ActiveRecordStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, ActionDispatch::PermissionsPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper, Rack::Attack, OmniAuth::Builder]>, @javascript_path="frontend", @encoding=#<Encoding:UTF-8>, @allow_concurrency=nil, @consider_all_requests_local=false, @filter_parameters=[:password, :bind_pw, :"state.body", :"state.article.body", :"article.body", :"article.attachments.data", :"attachments.data", :body, /^((?-mix:client_secret|authentication_token|access_token|refresh_token|code))$/], @filter_redirect=[], @helpers_paths=["/opt/zammad/app/helpers", "/usr/local/bundle/gems/doorkeeper-5.6.6/app/helpers"], @hosts=[], @host_authorization={}, @public_file_server=#<ActiveSupport::OrderedOptions {:enabled=>false, :index_name=>"index"}>, @force_ssl=false, @ssl_options={:hsts=>{:subdomains=>true}}, @session_store=:active_record_store, @time_zone="UTC", @beginning_of_week=:monday, @log_level=:info, @cache_store=[:mem_cache_store, "zammad-memcached:11211", {:expires_in=>7 days}], @railties_order=[:all], @relative_url_root=nil, @reload_classes_only_on_change=true, @file_watcher=ActiveSupport::FileUpdateChecker, @exceptions_app=nil, @autoflush_log=true, @log_formatter=#<Logger::Formatter:0x00007f8447befe38 @datetime_format=nil>, @eager_load=true, @secret_key_base=nil, @api_only=false, @debug_exception_response_format=nil, @x=#<Rails::Application::Configuration::Custom:0x00007f8447bf9528 @configurations={}>, @enable_dependency_loading=false, @read_encrypted_secrets=false, @content_security_policy=#<ActionDispatch::ContentSecurityPolicy:0x00007f8447a7d2f8 @directives={"base-uri"=>["'self'", #<Proc:0x00007f8447a7d1b8 /opt/zammad/config/initializers/content_security_policy.rb:32>], "default-src"=>["'self'", "ws:", "wss:", "https://images.zammad.com"], "font-src"=>["'self'", "data:"], "img-src"=>["*", "data:"], "object-src"=>["'none'"], "script-src"=>["'self'", "'unsafe-eval'"], "style-src"=>["'self'", "'unsafe-inline'"], "frame-src"=>["www.youtube.com", "player.vimeo.com"]}>, @content_security_policy_report_only=false, @content_security_policy_nonce_generator=#<Proc:0x00007f8447a7cba0 /opt/zammad/config/initializers/content_security_policy.rb:67 (lambda)>, @content_security_policy_nonce_directives=["script-src"], @require_master_key=false, @loaded_config_version=6.1, @credentials=#<ActiveSupport::OrderedOptions {:content_path=>#<Pathname:/opt/zammad/config/credentials.yml.enc>, :key_path=>#<Pathname:/opt/zammad/config/master.key>}>, @autoloader=:zeitwerk, @disable_sandbox=false, @add_autoload_paths_to_load_path=false, @permissions_policy=nil, @rake_eager_load=false, @paths=#<Rails::Paths::Root:0x00007f8447bf1940 @path=#<Pathname:/opt/zammad>, @root={"app"=>#<Rails::Paths::Path:0x00007f8447bf1788 @paths=["app"], @current="app", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="{*,*/concerns}", @exclude=["assets", "javascript"], @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/assets"=>#<Rails::Paths::Path:0x00007f8447bf1620 @paths=["app/assets"], @current="app/assets", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="*", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "app/controllers"=>#<Rails::Paths::Path:0x00007f8447bf1558 @paths=["app/controllers"], @current="app/controllers", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/channels"=>#<Rails::Paths::Path:0x00007f8447bf14b8 @paths=["app/channels"], @current="app/channels", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="**/*_channel.rb", @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/helpers"=>#<Rails::Paths::Path:0x00007f8447bf1418 @paths=["app/helpers"], @current="app/helpers", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/models"=>#<Rails::Paths::Path:0x00007f8447bf1378 @paths=["app/models"], @current="app/models", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/mailers"=>#<Rails::Paths::Path:0x00007f8447bf12d8 @paths=["app/mailers"], @current="app/mailers", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/views"=>#<Rails::Paths::Path:0x00007f8447bf1238 @paths=["app/views"], @current="app/views", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "lib"=>#<Rails::Paths::Path:0x00007f8447bf1198 @paths=["lib"], @current="lib", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=true>, "lib/assets"=>#<Rails::Paths::Path:0x00007f8447bf10d0 @paths=["lib/assets"], @current="lib/assets", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="*", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "lib/tasks"=>#<Rails::Paths::Path:0x00007f8447bf1030 @paths=["lib/tasks"], @current="lib/tasks", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="**/*.rake", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config"=>#<Rails::Paths::Path:0x00007f8447bf0fb8 @paths=["config"], @current="config", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/environments"=>#<Rails::Paths::Path:0x00007f8447bf0ec8 @paths=["config/environments"], @current="config/environments", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="production.rb", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/initializers"=>#<Rails::Paths::Path:0x00007f8447bf0e28 @paths=["config/initializers"], @current="config/initializers", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="**/*.rb", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/locales"=>#<Rails::Paths::Path:0x00007f8447bf0d88 @paths=["config/locales"], @current="config/locales", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="*.{rb,yml}", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/routes.rb"=>#<Rails::Paths::Path:0x00007f8447bf0d10 @paths=["config/routes.rb"], @current="config/routes.rb", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/routes"=>#<Rails::Paths::Path:0x00007f8447bf0c70 @paths=["config/routes"], @current="config/routes", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="**/*.rb", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "db"=>#<Rails::Paths::Path:0x00007f8447bf0bf8 @paths=["db"], @current="db", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "db/migrate"=>#<Rails::Paths::Path:0x00007f8447bf0b80 @paths=["db/migrate"], @current="db/migrate", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "db/seeds.rb"=>#<Rails::Paths::Path:0x00007f8447bf0b08 @paths=["db/seeds.rb"], @current="db/seeds.rb", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "vendor"=>#<Rails::Paths::Path:0x00007f8447bf0a68 @paths=["vendor"], @current="vendor", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=true>, "vendor/assets"=>#<Rails::Paths::Path:0x00007f8447bf09c8 @paths=["vendor/assets"], @current="vendor/assets", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="*", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/database"=>#<Rails::Paths::Path:0x00007f8447bf0928 @paths=["config/database.yml"], @current="config/database", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/secrets"=>#<Rails::Paths::Path:0x00007f8447bf0888 @paths=["config"], @current="config/secrets", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob="secrets.yml{,.enc}", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/environment"=>#<Rails::Paths::Path:0x00007f8447bf07e8 @paths=["config/environment.rb"], @current="config/environment", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "lib/templates"=>#<Rails::Paths::Path:0x00007f8447bf0770 @paths=["lib/templates"], @current="lib/templates", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "log"=>#<Rails::Paths::Path:0x00007f8447bf0680 @paths=["log/production.log"], @current="log", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "public"=>#<Rails::Paths::Path:0x00007f8447bf0608 @paths=["public"], @current="public", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "public/javascripts"=>#<Rails::Paths::Path:0x00007f8447bf0590 @paths=["public/javascripts"], @current="public/javascripts", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "public/stylesheets"=>#<Rails::Paths::Path:0x00007f8447bf0518 @paths=["public/stylesheets"], @current="public/stylesheets", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "tmp"=>#<Rails::Paths::Path:0x00007f8447bf04a0 @paths=["tmp"], @current="tmp", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/cable"=>#<Rails::Paths::Path:0x00007f8449c88ff0 @paths=["config/cable.yml"], @current="config/cable", @root=#<Rails::Paths::Root:0x00007f8447bf1940 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>}>, @autoload_paths=["/opt/zammad/lib"], @cache_classes=true, @log_tags=[:request_id], @logger=#<ActiveSupport::Logger:0x00007f8447ba2890 @level=1, @progname=nil, @default_formatter=#<Logger::Formatter:0x00007f8447ba4938 @datetime_format=nil>, @formatter=#<Logger::Formatter:0x00007f8447ba2778 @datetime_format=nil, @thread_key="activesupport_tagged_logging_tags:62580">, @logdev=#<Logger::LogDevice:0x00007f8447ba4820 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x00007f8447ba47d0>, @mon_data_owner_object_id=56380>>, @eager_load_paths=["/opt/zammad/app/channels", "/opt/zammad/app/controllers", "/opt/zammad/app/controllers/concerns", "/opt/zammad/app/frontend", "/opt/zammad/app/graphql", "/opt/zammad/app/helpers", "/opt/zammad/app/jobs", "/opt/zammad/app/jobs/concerns", "/opt/zammad/app/mailers", "/opt/zammad/app/models", "/opt/zammad/app/models/concerns", "/opt/zammad/app/policies", "/opt/zammad/app/services", "/opt/zammad/app/channels/graphql_channel.rb"], @autoload_once_paths=[], @session_options={:key=>"_zammad_session_a138cfd0f37"}> (NoMethodError)

Someone to help me please

The provided command and the return are incomplete.
What version are you using?

Thank you for the response.
Version : 6.00 (docker Compose on ubuntu 22.04)
Command:

Ticket::State.create_or_update(
  name: 'customer feedback',
  state_type_id: Ticket::StateType.find_by(name: 'open').id,
  ignore_escalation: true,
  created_by_id: 1,
  updated_by_id: 1,
)

Error:

method_missing': undefined method db_case_sensitive’

I’m not sure, but I think the .id at the end of state_type_id is incorrect.

state_type_id: Ticket::StateType.find_by(name: ‘open’).id, <— try without the .id

You may want to revisit the documentation on adding a new state.

https://docs.zammad.org/en/latest/admin/console/working-on-tickets.html#add-new-ticket-state

I have tried it, unfortunately, the same error still exists.

The issue should be fixed by now and was caused by a faulty compose setup within Zammad 6.0. Upgrade to the latest available version and try again. Please make sure to have a look at the upstream compose files which have changed.