Hi Kevin,
I want read custom form values in the ticket when:
- ticket is closed
- ticket is a specific HelpTopic
I tried to write the code but I don't like it :-( , this the code:
Signal::connect('object.edited', function($var) {
if($_REQUEST['id']) {
if (($ticket = Ticket::lookup($_REQUEST['id']))) {
$isClosed = $ticket->isClosed();
if ($isClosed){
if("CustomTopic"==$ticket->getHelpTopic()){
$topic = $ticket->getTopic();
$forms = $topic->getForms();
foreach($forms as $form) {
$fields=$form->getFields();
foreach($fields as $field) {
$value=$field->getValue();
if($value){
error_log($value);
}
}
}
}
}
}
}
});
Can you help me to write the correct code?
Thanks