Correct Way to create ticket with customs information | Community
Skip to main content

Correct Way to create ticket with customs information

  • April 18, 2023
  • 1 reply
  • 0 views

nathan17

Hello Community,

I'm using the php client from github to create tickets from our portal.

$newTicket = $client->tickets()->create([
    'subject'  => 'The brown fox jumps over the lazy dog',
    'custom_fields' =>  array( "dateofdeparture"=> "2022-11-23 17:50"), /*NOT WORKS*/
    'comment'  => [
    'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
                  'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
    ],
    'tags' => array("33"),  /* WORKS */
    'priority' => 'normal',
    
]);

 

I need your advice on how to use custom fields (or an other way) within the ticket (no dropdown select), I should save other user fields such as the internal id of the request made or other ids that need to be mapped.

How do you recommend implementing custom data/fields? Is it possible to show only some of them in the zendesk backend?

Do you have any reference documentation? from the research I carried out I have not correctly identified a solution but only "patches" that solve the problem not so nicely.

Greetings

1 reply

Eric27
  • April 19, 2023
Hey nathan,

This wrapper has been unmaintained and unsupported for quite a few years (We talk about this here). If you're still wanting to use this I'd suggest checking out this example that a user threw together for creating tickets with a custom field.

Thanks