id = $values['id'] ?? ''; $this->headline = $values['headline'] ?? ''; $this->type = $values['type'] ?? ''; $this->description = $values['description'] ?? ''; $this->projectId = $values['projectId'] ?? ''; $this->editorId = $values['editorId'] ?? ''; $this->userId = $values['userId'] ?? ''; $this->priority = $values['priority'] ?? ''; $this->date = $values['date'] ?? date('Y-m-d H:i:s'); $this->dateToFinish = $values['dateToFinish'] ?? ''; $this->status = $values['status'] ?? '3'; $this->storypoints = $values['storypoints'] ?? ''; $this->hourRemaining = $values['hourRemaining'] ?? ''; $this->planHours = $values['planHours'] ?? ''; $this->sprint = $values['sprint'] ?? ''; $this->acceptanceCriteria = $values['acceptanceCriteria'] ?? ''; $this->outcomeImpact = $values['outcomeImpact'] ?? ''; $this->tags = $values['tags'] ?? ''; $this->editFrom = $values['editFrom'] ?? ''; $this->editTo = $values['editTo'] ?? ''; $this->dependingTicketId = $values['dependingTicketId'] ?? ''; $this->milestoneid = $values['milestoneid'] ?? ''; $this->projectName = $values['projectName'] ?? ''; $this->clientName = $values['clientName'] ?? ''; $this->userFirstname = $values['userFirstname'] ?? ''; $this->userLastname = $values['userLastname'] ?? ''; $this->editorFirstname = $values['editorFirstname'] ?? ''; $this->editorLastname = $values['editorLastname'] ?? ''; $this->modified = $values['modified'] ?? ''; } } /** * Convert the ticket to a string representation that's useful for AI consumption */ public function __toString(): string { $output = "Ticket #{$this->id}: {$this->headline}\n"; $output .= "Type: {$this->type}\n"; $output .= "Status: {$this->status}\n"; $output .= "Priority: {$this->priority}\n"; if (! empty($this->description)) { $output .= 'Description: '.strip_tags($this->description)."\n"; } if (! empty($this->dateToFinish)) { $output .= "Due Date: {$this->dateToFinish}\n"; } if (! empty($this->editorFirstname) || ! empty($this->editorLastname)) { $output .= "Assigned To: {$this->editorFirstname} {$this->editorLastname}\n"; } if (! empty($this->storypoints)) { $output .= "Story Points: {$this->storypoints}\n"; } $output .= "Project ID: {$this->projectId}\n"; return $output; } }