You are not logged in.
When I try to assign a user to a ticket the method failed with Command not allowed error
php testxmlrpc.php --host=127.0.0.1 --url=dsi/sistemas/inventario/plugins/webservices/xmlrpc.php --session=0koaucvog54g8gjcopgd1hapt6 --method=glpi.setTicketAssign --ticket=4594 --user=6
xmlrpc error(16): Command not allowed
(ticket 4594 and user 6 are valid)
looking in the code, I found the error in the line 1998 of ./inc/methodhelpdesk.class.php
I comment out : || !self::checkUserRights($params['user'], 'ticket', Ticket::OWN, $entity)
and now is working!
Can you check it out?
if (!$ticket_user->can(-1, UPDATE, $user)
// DAMIAN 2015-07-27 con esto no funciona este metodo
// || !self::checkUserRights($params['user'], 'ticket', Ticket::OWN, $entity)
Thanks!!
Offline
You can't assign a ticket to a use if this user is not a technician (can't have right to be in charge of a ticket)
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
You can't assign a ticket to a use if this user is not a technician (can't have right to be in charge of a ticket)
The User I use to query is Super-Admin . shoud'nt this user have the right to assign a ticket?
(please excuse my english)
Offline
does your User have several profiles ?
is super admin profile valid on ticket entity for this user ?
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
does your User have several profiles ?
is super admin profile valid on ticket entity for this user ?
the user id=6 (name damian) is created in entity root (id=0) and has 2 profiles:
self-seervice (Dynamic) and super-admin (R: Recursive) for entity root
Offline
have you tried
glpi.setMyProfile method to select "superadmin" profile for this user
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
I Try to set glpi.setMyProfile with no luck. I continue to receive "Command not allowed "
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.doLogin</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.doLogin</string>
</value>
</member>
<member>
<name>login_name</name>
<value>
<string>webservice_ci</string>
</value>
</member>
<member>
<name>login_password</name>
<value>
<string>XXXXXXXX</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>23631</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>webservice_ci</string>
</value>
</member>
<member>
<name>realname</name>
<value>
<string/>
</value>
</member>
<member>
<name>firstname</name>
<value>
<string/>
</value>
</member>
<member>
<name>session</name>
<value>
<string>604g03v52v3ldmcaul0vpnpmf3</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setMyProfile</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setMyProfile</string>
</value>
</member>
<member>
<name>profile</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>604g03v52v3ldmcaul0vpnpmf3</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>4</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setTicketAssign</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setTicketAssign</string>
</value>
</member>
<member>
<name>user</name>
<value>
<int>6</int>
</value>
</member>
<member>
<name>ticket</name>
<value>
<int>4591</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>604g03v52v3ldmcaul0vpnpmf3</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value>
<int>16</int>
</value>
</member>
<member>
<name>faultString</name>
<value>
<string>Command not allowed</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
Offline
HI,
you log in with user webservice_ci (id=23631)
is ticket 4594 in root ?
has user webservice_ci (id=23631) a super-admin recursive profile on root ?
can this webservice user assign this ticket without using webservice ( you log in and use helpdesk interface)?
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
Yes webservice_ci is super-admin and if I use webservice_ci via the helpdesk interface I can assign the ticket without any problems. I have the problem if I do the action via the webservice interface
Here is the webservice dialog (i add an listMyProfiles call to check
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.doLogin</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.doLogin</string>
</value>
</member>
<member>
<name>login_name</name>
<value>
<string>webservice_ci</string>
</value>
</member>
<member>
<name>login_password</name>
<value>
<string>XXXXXXX</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>23631</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>webservice_ci</string>
</value>
</member>
<member>
<name>realname</name>
<value>
<string/>
</value>
</member>
<member>
<name>firstname</name>
<value>
<string/>
</value>
</member>
<member>
<name>session</name>
<value>
<string>ms92hu3p9clcfprvstu3md7ov3</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setMyProfile</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setMyProfile</string>
</value>
</member>
<member>
<name>profile</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>ms92hu3p9clcfprvstu3md7ov3</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>4</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.listMyProfiles</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.listMyProfiles</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>ms92hu3p9clcfprvstu3md7ov3</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>6</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Technician</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>0</int>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setTicketAssign</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setTicketAssign</string>
</value>
</member>
<member>
<name>user</name>
<value>
<int>6</int>
</value>
</member>
<member>
<name>ticket</name>
<value>
<int>4594</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>ms92hu3p9clcfprvstu3md7ov3</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value>
<int>16</int>
</value>
</member>
<member>
<name>faultString</name>
<value>
<string>Command not allowed</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
Offline
I use GLPI 0.85.4 and webservices 1.5.0
Offline
yllen wrote:You can't assign a ticket to a use if this user is not a technician (can't have right to be in charge of a ticket)
The User I use to query is Super-Admin . shoud'nt this user have the right to assign a ticket?
(please excuse my english)
Your user must have right to own ticket.
In your examples, user = 6 . Has this user right?
Do not confuse the ticket editor and technician assign to the ticket (--user=xx is the technician assign)
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
The user damian (id=6) has the same rights than webservice_ci.
I execute the query with user=damian with the same results
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.doLogin</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.doLogin</string>
</value>
</member>
<member>
<name>login_name</name>
<value>
<string>damian</string>
</value>
</member>
<member>
<name>login_password</name>
<value>
<string>XXXXXX</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>6</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>damian</string>
</value>
</member>
<member>
<name>realname</name>
<value>
<string>Fernandez Sosa (DSI)</string>
</value>
</member>
<member>
<name>firstname</name>
<value>
<string>Damian Alejandro</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>afp4426l1ndms9q3u7enecjui5</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setMyProfile</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setMyProfile</string>
</value>
</member>
<member>
<name>profile</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>afp4426l1ndms9q3u7enecjui5</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>4</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.listMyProfiles</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.listMyProfiles</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>afp4426l1ndms9q3u7enecjui5</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>1</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Self-Service</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>0</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>6</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Technician</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>0</int>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setTicketAssign</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setTicketAssign</string>
</value>
</member>
<member>
<name>user</name>
<value>
<int>6</int>
</value>
</member>
<member>
<name>ticket</name>
<value>
<int>4594</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>afp4426l1ndms9q3u7enecjui5</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value>
<int>16</int>
</value>
</member>
<member>
<name>faultString</name>
<value>
<string>Command not allowed</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
Offline
is ticket 4594 in root ?
there are 3 params in "checkUserRights($params['user'], 'ticket', Ticket::OWN, $entity)";
have you also checked glpi.listMyEntities and glpi.setMyEntity ?
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
No success
The ticket is created on entity ConectarIgualdad and the user damian is superadmin and tecnitian on root entity (recursive)
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.doLogin</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.doLogin</string>
</value>
</member>
<member>
<name>login_name</name>
<value>
<string>damian</string>
</value>
</member>
<member>
<name>login_password</name>
<value>
<string>XXXX</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>6</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>damian</string>
</value>
</member>
<member>
<name>realname</name>
<value>
<string>Fernandez Sosa (DSI)</string>
</value>
</member>
<member>
<name>firstname</name>
<value>
<string>Damian Alejandro</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2c63l0o2rr2voj05vq6o1v5du1</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setMyProfile</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setMyProfile</string>
</value>
</member>
<member>
<name>profile</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2c63l0o2rr2voj05vq6o1v5du1</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>4</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.listMyProfiles</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.listMyProfiles</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2c63l0o2rr2voj05vq6o1v5du1</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>1</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Self-Service</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>0</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>6</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Technician</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>0</int>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.listMyEntities</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.listMyEntities</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2c63l0o2rr2voj05vq6o1v5du1</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>0</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Root entity</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>-1</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string/>
</value>
</member>
<member>
<name>level</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>ConectarIgualdad</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>0</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > ConectarIgualdad</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string>Incidencias sobre ConectarIgualdad</string>
</value>
</member>
<member>
<name>level</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>CNBA</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>0</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > CNBA</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string>Todo el Colegio</string>
</value>
</member>
<member>
<name>level</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>3</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>En Deposito</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > CNBA > En Deposito</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string/>
</value>
</member>
<member>
<name>level</name>
<value>
<string>3</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>4</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>EXTERNOS</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>0</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > EXTERNOS</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string/>
</value>
</member>
<member>
<name>level</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>5</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Dada de Baja</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > CNBA > Dada de Baja</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string/>
</value>
</member>
<member>
<name>level</name>
<value>
<string>3</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setMyEntity</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setMyEntity</string>
</value>
</member>
<member>
<name>entity</name>
<value>
<int>1</int>
</value>
</member>
<member>
<name>recursive</name>
<value>
<int>1</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2c63l0o2rr2voj05vq6o1v5du1</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > ConectarIgualdad</string>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setTicketAssign</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setTicketAssign</string>
</value>
</member>
<member>
<name>user</name>
<value>
<int>6</int>
</value>
</member>
<member>
<name>ticket</name>
<value>
<int>4594</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2c63l0o2rr2voj05vq6o1v5du1</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value>
<int>16</int>
</value>
</member>
<member>
<name>faultString</name>
<value>
<string>Command not allowed</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
Offline
not sure but :
in your requests "user id" is an <int> type
in answers user id is an <string> type
error message is "faultString".
also for ticket #...
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
I tryed to add (int) to the user and the ticket# but that don't solve the issue
not sure but :
in your requests "user id" is an <int> type
in answers user id is an <string> typeerror message is "faultString".
also for ticket #...
Offline
instead of
user=6
try
user="6"
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
I use "6" for the user and "4594" for the ticket , but it does not work
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.doLogin</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.doLogin</string>
</value>
</member>
<member>
<name>login_name</name>
<value>
<string>damian</string>
</value>
</member>
<member>
<name>login_password</name>
<value>
<string>XXXXXXXXX</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>6</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>damian</string>
</value>
</member>
<member>
<name>realname</name>
<value>
<string>Fernandez Sosa (DSI)</string>
</value>
</member>
<member>
<name>firstname</name>
<value>
<string>Damian Alejandro</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2apn531qt2jhfc430ar470bjl7</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setMyProfile</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setMyProfile</string>
</value>
</member>
<member>
<name>profile</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2apn531qt2jhfc430ar470bjl7</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>4</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.listMyProfiles</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.listMyProfiles</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2apn531qt2jhfc430ar470bjl7</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>1</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Self-Service</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>0</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>4</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Super-Admin</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<int>6</int>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Technician</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>0</int>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.listMyEntities</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.listMyEntities</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2apn531qt2jhfc430ar470bjl7</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>0</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Root entity</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>-1</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string/>
</value>
</member>
<member>
<name>level</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>ConectarIgualdad</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>0</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > ConectarIgualdad</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string>Incidencias sobre ConectarIgualdad</string>
</value>
</member>
<member>
<name>level</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>CNBA</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>0</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > CNBA</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string>Todo el Colegio</string>
</value>
</member>
<member>
<name>level</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>3</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>En Deposito</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > CNBA > En Deposito</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string/>
</value>
</member>
<member>
<name>level</name>
<value>
<string>3</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>4</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>EXTERNOS</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>0</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > EXTERNOS</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string/>
</value>
</member>
<member>
<name>level</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>5</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>Dada de Baja</string>
</value>
</member>
<member>
<name>entities_id</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > CNBA > Dada de Baja</string>
</value>
</member>
<member>
<name>comment</name>
<value>
<string/>
</value>
</member>
<member>
<name>level</name>
<value>
<string>3</string>
</value>
</member>
<member>
<name>is_recursive</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>current</name>
<value>
<int>1</int>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setMyEntity</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setMyEntity</string>
</value>
</member>
<member>
<name>entity</name>
<value>
<int>1</int>
</value>
</member>
<member>
<name>recursive</name>
<value>
<int>1</int>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2apn531qt2jhfc430ar470bjl7</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>id</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>completename</name>
<value>
<string>Root entity > ConectarIgualdad</string>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
REQUEST:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>glpi.setTicketAssign</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>method</name>
<value>
<string>glpi.setTicketAssign</string>
</value>
</member>
<member>
<name>user</name>
<value>
<string>6</string>
</value>
</member>
<member>
<name>ticket</name>
<value>
<string>4594</string>
</value>
</member>
<member>
<name>session</name>
<value>
<string>2apn531qt2jhfc430ar470bjl7</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value>
<int>16</int>
</value>
</member>
<member>
<name>faultString</name>
<value>
<string>Command not allowed</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
Last edited by damian (2015-09-01 12:29:59)
Offline
i'll update my webservice plugin on my test server and try to reproduce.
(i have slightly modified your post to make the discussion more readable using the "code" tag)
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
This error is when the --user indicated has no right to be in charge of a ticket ins the entity of the ticket.
If your user has multi-entities, you must select in which entity you want to work.
So, before methodsetTicketAssign, you must call methodSetMyEntity to affect current entity of the user.
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
@ yllen :
looking at the post #18
damian logged in the set profile to superadmin, then set entity to 1 (same as ticket) .
the response of webservices is ok ( profile=super-admin & entity=root>ConectarIgualdad)
then called methodsetTicketAssign.
what surprises me is that entity id is -1 for root. i thought root had id=0;
@Damian :
you wrote (#9) that with helpdesk interface user Damian(with superadmin profile on entity #1 ) can assign tickets#4594 to Damian : can you confirm ?
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
I don't understand.
root>ConectarIgualdad is not root entity but a sub entity.
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
@ yllen
forget id=-1 for root; (entity_id is different from id )
I did not see the difference between "entity_id" and "id" ( sorry)
in webservice response(list my entities)
root>in deposito has id=3
root>CNBA has id=2
root>ConectarIgualdad has id=1 (that seems ok)
root has id=0
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
@ yllen :
looking at the post #18
damian logged in the set profile to superadmin, then set entity to 1 (same as ticket) .
the response of webservices is ok ( profile=super-admin & entity=root>ConectarIgualdad)
then called methodsetTicketAssign.what surprises me is that entity id is -1 for root. i thought root had id=0;
@Damian :
you wrote (#9) that with helpdesk interface user Damian(with superadmin profile on entity #1 ) can assign tickets#4594 to Damian : can you confirm ?
Yes!! I confirm that I can Assign user damian to the ticket, I'll try to upload an image
Offline
The Ticket is not assigned to damian
Now, via helpdesk interface, damian has assigned the ticket (in the botton left of 2nd image you can see that user damian is id=6)
Last edited by damian (2015-09-03 05:40:52)
Offline