| Conditions | 2 |
| Paths | 2 |
| Total Lines | 29 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 2 |
| 1 | <?php |
||
| 61 | public function createTicket(array $ticket, array $customField = []) |
||
| 62 | { |
||
| 63 | $body = [ |
||
| 64 | "requester" => [ |
||
| 65 | "email" => ($ticket["requester_email"]), |
||
| 66 | "name" => ($ticket["requester_name"]) |
||
| 67 | ], |
||
| 68 | "summary" => ($ticket["summary"] ?? null), |
||
| 69 | "comments" => [ |
||
| 70 | "description" => [ |
||
| 71 | "content" => ($ticket["comments_content"] ?? null) |
||
| 72 | ] |
||
| 73 | ], |
||
| 74 | "idProductRelated" => ($ticket["product"] ?? null) |
||
| 75 | ]; |
||
| 76 | |||
| 77 | if ($customField) { |
||
| 78 | $body = array_merge(["customField" => $customField], $body); |
||
| 79 | } |
||
| 80 | |||
| 81 | $this->request( |
||
| 82 | "POST", |
||
| 83 | "tickets", |
||
| 84 | $body, |
||
| 85 | null, |
||
| 86 | true |
||
| 87 | ); |
||
| 88 | |||
| 89 | return $this; |
||
| 90 | } |
||
| 91 | } |