Hello, some of my tickets may be fixed w/o human needs, like: "I did not recive email, pls send it to me again". I want for choosen category after OST create ticket execute some script with provided variables ( i see it like curl with POST var). My script do something and close ticket if success. Does it somehow possible with OST?

This is not currently a feature in osTicket. 

I thought a little about possibilities.I think i can get ticket by asking what i need directly from mysql.But next question how to close tickets after php self-solve it? I guess, i have to duplicate what ost do to close ticket, any helpful direction to file i need?

Depending on if the email you're reffering to is from osticket then you should be able to do it all in the post process but if it's an external process you can use the below code to close the ticket from a script.Create this file under /api/close_ticket.php<?php@[deleted](dirname(__FILE__).'/'); //Change dir.require('api.inc.php');if (!osTicket:())    die(__('close_ticket.php only supports local cron calls - use http -> api/tasks/cron'));if (!isset($_GET)) die(__('close_ticket.php requires the ticket_id parameter ?ticket_id=1'));require_once(INCLUDE_DIR.'class.ticket.php');if(($temp = Ticket:($_GET))) echo $temp->setState('closed');?>Then you should be able to close the ticket with %PHPDIR%/php.exe %OSTICKET%/api/close_ticket.php?ticket_id=1where you change the 1 to the id of the ticket you want to close, and the directory variables with your paths.

Thanks, i got the idea. Is there a function to add inner coment before close ticket? 

$temp->logActivity("Title", "Message body.");

6 days later

It work, almost.That part work: $temp->logActivity("Title", "Message body."); That one executed, but nothing changes and print nothingecho $temp->setState('closed');That code from class.ticket.php function setState($state, $alerts=false) {

switch (strtolower($state)) {

case 'open':

return $this->setStatus('open');

case 'closed':

return $this->setStatus('closed');i think that $this may not exist?

Write a Reply...