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

Objects Manager add new State #574

Open
ECM80 opened this Issue Jan 2, 2017 · 24 comments

Comments

Projects
None yet
@ECM80
Copy link

ECM80 commented Jan 2, 2017

In the object manager, I can not create a new ticket status. If you click the manger / Tickets object, everything is not clickable

@ECM80

This comment has been minimized.

Copy link

ECM80 commented Jan 2, 2017

Could someone explain to me how I can add a new status. I need the status "Solved".

For any help I would be very grateful

@ECM80

This comment has been minimized.

Copy link

ECM80 commented Jan 4, 2017

UPDATE:

I have added a new TicketState in the documentation via API interface. The new status does not appear.

{
	"id": 11,
	"state_type_id": 10,
	"name": "In Bearbeitung",
	"next_state_id": null,
	"ignore_escalation": true,
	"note": "In Bearbeitung",
	"active": true,
	"updated_by_id": 3,
	"created_by_id": 3,
	"created_at": "2017-01-02T21:13:27.003Z",
	"updated_at": "2017-01-02T21:13:27.003Z"
}

states

@tojaskiba

This comment has been minimized.

Copy link
Contributor

tojaskiba commented Mar 9, 2017

+1
I also added new status via api but it doesn't show up. What could be wrong?

@ThePatzen

This comment has been minimized.

Copy link

ThePatzen commented Mar 10, 2017

I also need a state "Work in progress" 👍

@martini martini self-assigned this Mar 14, 2017

@martini

This comment has been minimized.

Copy link
Collaborator

martini commented Mar 14, 2017

In the meantime a small howto/workaround to add a new state via rails console (our goal is to cover it via the UI):

Add a new state, let's say "customer feedback":

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

As second you need to tell the ticket state attribute to allow it to select, here is a example, please take care (in case you are not know what you are going to do, create an database backup first)!

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

This comment has been minimized.

Copy link
Contributor

tojaskiba commented Mar 15, 2017

So you say API is wrong in this case? Maybe it should be noted in documentation?

@martini

This comment has been minimized.

Copy link
Collaborator

martini commented Mar 15, 2017

So you say API is wrong in this case? Maybe it should be noted in documentation?

You also can use the REST API to do this changes.

-=> Our goal is to cover it via the UI. So this is just a small mini howto/workaround unit the UI is available.

@cmadle

This comment has been minimized.

Copy link

cmadle commented Apr 26, 2017

Our goal is to cover it via the UI. So this is just a small mini howto/workaround unit the UI is available.

+1 for this UI enhancement

@dennybresch

This comment has been minimized.

Copy link
Collaborator

dennybresch commented May 8, 2017

+1 for this UI enhancement

@rkopplin

This comment has been minimized.

Copy link

rkopplin commented Sep 13, 2017

is there a way to access new created states via api?
like query search state:newone ?

i've created 2 more states and they are working fine but need api access

@pebosi

This comment has been minimized.

Copy link
Contributor

pebosi commented Nov 8, 2017

@skibson Trying to make this change via API the following response is returned:

"error": "Attribute not editable!"

@svnr-dvnkln

This comment has been minimized.

Copy link

svnr-dvnkln commented Nov 16, 2017

What do you have to alter to make a second or third state visible?
It's only working for the first state we ever added via rails.

NVM restarting Zammad did it..

But is there a way to make the state behave like the "pending reminder" one? I want to add a date related to the state.

Setting the state type to the same type as "pending reminder" didn't work.

@AchuM

This comment has been minimized.

Copy link

AchuM commented Feb 15, 2018

@martini

I'm getting the following error when i followed your steps:

SyntaxError: (irb):11: syntax error, unexpected tIDENTIFIER, expecting ')' name: 'state_id',

Any idea why?
I'm on zammad 2.3
Thanks!

@muhammadn

This comment has been minimized.

Copy link
Contributor

muhammadn commented Feb 15, 2018

@AchuM Maybe you forgot the last closing ")" parentheses. Try checking on that. 😊

@thorsteneckel

This comment has been minimized.

Copy link
Collaborator

thorsteneckel commented Feb 15, 2018

Hi @AchuM - seems there was an issue while copy pasting the content into the console. I would recommend to past the content into a file in your $ZAMMAD_DIR like e.g. $ZAMMAD_DIR/add_state.rb and execute it via rails r add_state.rb from your $ZAMMAD_DIR.

Seems you missed a comma in front of the described line name: 'state_id',.

@AchuM

This comment has been minimized.

Copy link

AchuM commented Feb 16, 2018

Yes! ) was my mistake 🙈

@thorsteneckel That's a very good tip, Thanks! I will do that until we have this via UI

Thank you!

@AchuM

This comment has been minimized.

Copy link

AchuM commented Feb 28, 2018

@martini @thorsteneckel Is there a way to completely disable state selection for customers? Thanks!

@thorsteneckel thorsteneckel changed the title Objects Manager ad new State Objects Manager add new State Mar 1, 2018

@gualican

This comment has been minimized.

Copy link

gualican commented Mar 5, 2018

@martini how would you translate those rails shell commands to pure Elasticsearch API calls?
Having installed the DEB package calling /opt/zammad/bin/rails c returns dependencies errors and, not being accustomed to ruby, I can't add a new state.

@anicoa

This comment has been minimized.

Copy link

anicoa commented Mar 8, 2018

@swissdeveloper

This comment has been minimized.

Copy link

swissdeveloper commented Oct 23, 2018

@martini do you know when does the UI for the state will be available? We would also like to set the color of the state.

In additional we would also like that user are not able to change the state of a ticket. They often select a wrong one, only agent should be able to do it.

@kagashe

This comment has been minimized.

Copy link

kagashe commented Oct 29, 2018

+1 for this feature as well.

@Premyslaw

This comment has been minimized.

Copy link

Premyslaw commented Dec 5, 2018

+1 for this Feature

@Memphizzz

This comment has been minimized.

Copy link

Memphizzz commented Jan 14, 2019

+1

@zammad zammad locked and limited conversation to collaborators Jan 14, 2019

@MrGeneration

This comment has been minimized.

Copy link
Collaborator

MrGeneration commented Jan 14, 2019

Locking the conversation for now, as this issue hasn't received any usefull comments in the past, but just +1s.

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