You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2020-02-20 22:19:23

mecmav
Member
From: Brasil
Registered: 2019-03-22
Posts: 326

[solved]BUG in plugin Behavior 2.2.1 and 2.2.2

Hi

I think we found a bug on that plugin.

Step by step to have the error: GLPI 9.4.2 OR 9.4.5 still the same error and with plugin behavior 2.2.1 or 2.2.2

In configuration of plugin we need set:

--> "Requester is mandatory" to "yes";

When try create an ticket using apirest.php/Ticket/  (POST), passing exactly these values:

{
     "input": {
                 "users_id":1775,
        "type":1,
        "itilcategories_id":45,
        "requesttypes_id":6,
        "urgency":4,
        "impact":4,
        "priority":3
     }
}

we get the following error "[
    "ERROR_GLPI_ADD",
    "Requerente é mandatório"
]"

even passing the id of requester to the field "users_id", I'm getting this error.

Only add the ticket when the "Requester is mandatory" is "no".

Am I doing something wrong or this is really a bug?

Offline

#2 2020-02-25 18:15:36

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: [solved]BUG in plugin Behavior 2.2.1 and 2.2.2

In Behaviors plugin i used same value as in the core of GLPI.

If you create a ticket in GLPI or with the plugin Webservices you don't have this issue, so the issue is in the API.

I move your post in API part


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

#3 2020-02-26 19:15:44

mecmav
Member
From: Brasil
Registered: 2019-03-22
Posts: 326

Re: [solved]BUG in plugin Behavior 2.2.1 and 2.2.2

Yes, at creating a ticket in GUI GLPI even when the plugin config "Requester is mandatory" setted to "Yes", we have no problem, the behavior work as expected. but in the API the same option defined to "yes", we provide that field value and get the error.

I didn't try by webservices, but by API having this error.

With differents versions of GLPI core and plugin behavior, this erros occurs.

Thanks by your reply.

We need wait for a correction or already have a commit for it ?

Last edited by mecmav (2020-02-26 19:18:35)

Offline

#4 2020-02-29 14:56:22

mecmav
Member
From: Brasil
Registered: 2019-03-22
Posts: 326

Re: [solved]BUG in plugin Behavior 2.2.1 and 2.2.2

I'm using API for integrate with other systems.

So I need to know if have any commit for it, or we have need to wait for a new release??

I need  this behavior "requester is mandatory" setted to "yes", and haven't a way to use webservices in this case, because all the integration was made for API.

Offline

#5 2020-03-17 14:38:09

mecmav
Member
From: Brasil
Registered: 2019-03-22
Posts: 326

Re: [solved]BUG in plugin Behavior 2.2.1 and 2.2.2

Anyone with this behavior ?

Offline

#6 2020-04-21 16:33:14

Balex
Member
Registered: 2020-04-21
Posts: 3

Re: [solved]BUG in plugin Behavior 2.2.1 and 2.2.2

Hello,

I'm facing exactly the same issue as you unfornatly,

That is blocking us on a script to create tickets from our monitoring tools hmm

Did you manage to fixe the bug ? or to bypass it with behavior enabled

GLPI version : 9.4.4
Behaviors version : 2.2.2

Thanks in advance

Best regards,

Last edited by Balex (2020-04-21 16:34:23)

Offline

#7 2020-04-21 17:44:54

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,146

Re: [solved]BUG in plugin Behavior 2.2.1 and 2.2.2

i think users_id_requester is missing in JSON payload

{
     "input": {
                 "users_id_requester":1775,
        "type":1,
        "itilcategories_id":45,
        "requesttypes_id":6,
        "urgency":4,
        "impact":4,
        "priority":3
     }
}

Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

#8 2020-04-22 11:52:32

Balex
Member
Registered: 2020-04-21
Posts: 3

Re: [solved]BUG in plugin Behavior 2.2.1 and 2.2.2

Bonjour LaDenrée,
Sorry for the lack of information on my issue but I got well this information in my curl POST,

exemple of a try :

curl -X POST -H 'Content-Type: application/json' -H "Session-Token: mysessiontoken" -H "App-Token: myapptoken" -d '{
"input": 
{
"status":2,
"urgency":3,
"impact":3,
"priority":3,
"itilcategories_id":0,
"_users_id_requester":10037,
"type":1,
"requesttypes_id":10001,
"users_id":10037,
"name": "test API"
}
}'  "http://myserver/glpi/apirest.php/Ticket/"

and it return : "ERROR_GLPI_ADD","Demandeur est obligatoire" ( in english : ERROR_GLPI_ADD","Requester is mandatory" )

and it's the same even without the "_" in font of "users_id_requester"

And without the plugging I got well the requester field with the user sad

Thanks and best regards,

Last edited by Balex (2020-04-22 11:59:41)

Offline

#9 2020-04-22 12:06:11

Balex
Member
Registered: 2020-04-21
Posts: 3

Re: [solved]BUG in plugin Behavior 2.2.1 and 2.2.2

Mea culpa ..!

I double checked just now,
with "_users_id_requester" it works !
and it's not with "users_id_requester"

I'm so sorry, my bad typo error !

Thanks Ladenrée for the tips !

Thanks again and best regards !

Offline

Board footer

Powered by FluxBB