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 2024-05-16 18:00:27

andres.castellanos
Member
Registered: 2024-03-11
Posts: 1

add Key to save on apirest.php/Ticket

Hi

I'm using the api rest "h t t p://XXX.XXX.XXX.XXXX/glpi/apirest.php/Ticket"

Whit the body request

{
    "input": [
        {
            "name": "suport desk",
            "content": "my pc don't turn on",
            "itilcategories_id": "5",
            "type": "1",
            "_users_id_requester": "7",
            "user_email": "usuarios@spradling.group"
        }
    ]
}

This work ok, but i need add the value of the key user_email into my content key, the problem is my post service y cant concat this information this is why we send on diferente keys.

Any one know how could I concat this key on the code?.

I try on \glpi\src\Ticket.php add

if (isset($options['name'])) {
$order           = ["\\'", '\\"', "\\\\"];
$replace         = ["'", '"', "\\"];
$options['name'] = str_replace($order, $replace, $options['name']);
$options['name'] =$options['name'].''.$options['user_email'];
}

But this doesn't work.

Offline

Board footer

Powered by FluxBB