Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/Application/Controller/XMLRPC/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,34 @@ public function assignNextUnassignedForState($ticketType = '', $ticketState = ''
$this->_assignedProjects,
$tickets
);


if($propertyFilters) {
$tickets->filter(function(array $entry) use ($tickets, $propertyFilters) {
$ticket = new Ticket();
$ticket->init($entry);

$valid = false;
$unmatchedFilters = [];
$properties = $ticket->MergedProperties->toArray();
foreach ($propertyFilters as $filter_key => $filter_value) {
if (
isset($properties[$filter_key]) and
(string) $properties[$filter_key]['value'] === $filter_value
or
!isset($properties[$filter_key]) and $filter_value === ''
) {
// TODO: for "NOT"/"NONE": set $filter here, break
$valid = true;
continue;
}

$unmatchedFilters[] = $filter_key;
}

if($valid) return true; else return false;
});
}

$ticket = $tickets->first();
} catch(Exception $e) {
Log::warning($e->getMessage());
Expand Down