$result = '<div class="alert alert-success">' . $result . '</div>'; } } if (!isset($result) && !($errSubject || $errDesc || $errType || $errLevel || $errName || $errEmail || $errHuman)) { $result = '<div class="alert alert-danger">Beklager, din henvendelse kunne ikke registres.</div>'; } } else { if ($id) { if ($issue = taiga_get_issue_by_ref($auth, $id)) { $subject = isset_get($issue, 'subject'); $type = isset_get($issue, 'type'); $status = isset_get($issue, 'status_extra_info'); $assigned = isset_get($issue, 'assigned_to_extra_info'); $level = isset_get($issue, 'severity'); $description = isset_get($issue, 'description'); if ($attrs = taiga_get_issue_attributes($auth, $issue['id'])) { $attrs = $attrs['attributes_values']; $name = isset_get($attrs, '1671'); $email = isset_get($attrs, '1672'); } $comments = taiga_get_issue_comments($auth, $issue['id']); } } } } else { $result = '<div class="alert alert-danger">Beklager, din henvendelse kan ikke registres. Prøv igjen senere.</div>'; } ?> <!DOCTYPE html> <html lang="en">
function taiga_edit_issue_attributes($auth, $id) { if ($attributes = taiga_get_issue_attributes($auth, $id)) { $version = $attributes['version']; $process = curl_init(TAIGA_HOST . "issues/custom-attributes-values/{$id}"); curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8', "Authorization: Bearer {$auth}")); curl_setopt($process, CURLOPT_CUSTOMREQUEST, "PATCH"); // Id's collected using https://api.taiga.io/api/v1/issue-custom-attributes?project=121115 curl_setopt($process, CURLOPT_POSTFIELDS, json_encode(array('attributes_values' => array('1671' => filter_post('name'), '1672' => filter_post('email')), 'version' => $version, 'issue' => $id))); curl_setopt($process, CURLOPT_RETURNTRANSFER, true); if ($attributes = curl_exec($process)) { $attributes = json_decode($attributes, true); } curl_close($process); } return $attributes; }