Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing status field after adding new status #1127

Closed
Cr0wl3r opened this issue May 23, 2017 · 7 comments
Closed

missing status field after adding new status #1127

Cr0wl3r opened this issue May 23, 2017 · 7 comments
Assignees

Comments

@Cr0wl3r
Copy link

Cr0wl3r commented May 23, 2017

Hi,

I tried to create a new status as explained in #574
after adding the new status with the following rails command lines, there is the status field missing in every ticket.

Ubuntu 16.04.2 LTS
Zammad Version 1.5.x

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

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(name: 'open').id,
    translate: true,
    filter: [
      Ticket::State.find_by(name: 'new').id,
      Ticket::State.find_by(name: 'open').id,
      Ticket::State.find_by(name: 'pending reminder').id,
      Ticket::State.find_by(name: 'closed').id,
      Ticket::State.find_by(name: 'pending close').id,
      Ticket::State.find_by(name: 'in progress').id,
    ],
  },
  editable: false,
  active: true,
  screens: {
    create_middle: {
      Agent: {
        null: false,
        item_class: 'column',
      },
      Customer: {
        item_class: 'column',
        nulloption: false,
        null: true,
        filter: [
          Ticket::State.find_by(name: 'new').id,
          Ticket::State.find_by(name: 'closed').id
        ],
        default: Ticket::State.find_by(name: 'new').id,
      },
    },
    edit: {
      Agent: {
        nulloption: false,
        null: false,
        filter: [
          Ticket::State.find_by(name: 'open').id,
          Ticket::State.find_by(name: 'pending reminder').id,
          Ticket::State.find_by(name: 'closed').id,
          Ticket::State.find_by(name: 'pending close').id,
          Ticket::State.find_by(name: 'in progress').id,
        ],
      },
      Customer: {
        nulloption: false,
        null: true,
        filter: [
          Ticket::State.find_by(name: 'open').id,
          Ticket::State.find_by(name: 'closed').id
        ],
        default: Ticket::State.find_by(name: 'open').id,
       },

    },
  },
  to_create: false,
  to_migrate: false,
  to_delete: false,
  position: 40,
)
@martini
Copy link
Collaborator

martini commented May 29, 2017

Hi @Cr0wl3r

the statement has changed. Please verify new one. If it's working I'll update #574

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,
)

@martini martini self-assigned this May 29, 2017
@Cr0wl3r
Copy link
Author

Cr0wl3r commented May 29, 2017

Great, now it's working.
Thanks!

@martini
Copy link
Collaborator

martini commented May 29, 2017

Thanks for feedback!

@martini martini closed this as completed May 29, 2017
@RobertKalteis
Copy link

Hi I've same problem rails don't show the new states and I want to change one of my created states.
On webview states are visible but
rails> Ticket::StateType.all
just show default states

@thorsteneckel
Copy link
Contributor

Hi @RobertKalteis - please use our community board for technical questions. However, it looks like you mixed things up. Ticket::StateTypes are not Ticket::States. Please create topic over at the board and describe what you want to do and what you've already done. Thanks!

@danielehrhardt
Copy link

Now we have 2021 and this still does not work over the UI?
If i create a Status Type over the API it is missing in the UI is there a way to add it to the List with the API and without the CLI?

#574

@zammad zammad locked and limited conversation to collaborators Mar 30, 2021
@MrGeneration
Copy link
Member

Please don't pump / recycle old issues that are closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants