- Edited
I'm able to create new ticket using API. What's the field to assign an agent number?
Also, what is the field name for due date assignment?
I'm able to create new ticket using API. What's the field to assign an agent number?
Also, what is the field name for due date assignment?
Figured out the agent number field is "staffId". Still need to know the due date field.
This doesn't work:
'duedate' => '2023-09-15',
paste here all your api code, so we can help you
this is straight out of the api_ticket_create.php file with some added array fields. This code does create the new ticket with the correct staffid, topicID and companyid. However, it doesn't accept the due date. Instead, it inserts a date 2 days from the date the ticket is created.
$data = array(
'name' => 'new tickets',
'email' => 'contact@xxxxxx.org',
'staffId' => 8,
'topicId' => 21,
'duedate' => '2023-09-15',
'subject' => 'Test API message',
'message' => 'This is a test of the osTicket API',
'companyid' => '267',
'ip' => $_SERVER['REMOTE_ADDR'],
'attachments' => array(),
);
time didn't work
'duedate' => '2023-09-15 00:00:00',
any other advice in getting the due date inserted using API?
This is on my list to test but unfortunately I have a million other things to do before this. I will get there in time. Looking at the code it should be possible but I’m not 100% certain as we have allowed fields, etc. depending on how the ticket is being created.
Cheers.
didn't work
Does the script work otherwise?
(if you do not try to set the duedate)
Hi. Bumping up to see if there has been any progress on this issue.
Go to the line below, add 'duedate',
to this line, save the changes, and retest.
Cheers.
added duedate to the line and still doesn't work
any update to adding due date?
Copy this line:
… and paste it in the api
case below it. You may also need the change I mentioned above in addition.
Cheers.
Can you please clarify? Where in the api.tickets.php should I add the line?
I said above, "Copy this line [insert link with specific line to copy] and paste it in the api
case below it." This means copy the line in the referenced link and paste it in the api
switch case (which is below the line you are copying).
Cheers.