Skip to content
Snippets Groups Projects
Commit 6659b62e authored by Daniel Speicher's avatar Daniel Speicher
Browse files

Issue #3257063 by danielspeicher: Make body field of issues required

parent bd10c12d
Branches
Tags
No related merge requests found
......@@ -19,6 +19,7 @@ use Zendesk\API\Exceptions\CustomException;
use Zendesk\API\Exceptions\MissingParametersException;
use Zendesk\API\Exceptions\ResponseException;
use Zendesk\API\HttpClient;
use function PHPUnit\Framework\isEmpty;
/**
* Plugin implementation of the Zendesk helpdesk.
......@@ -151,10 +152,14 @@ class Zendesk extends PluginBase {
$client = self::getClient($helpdesk, $issue->getOwner()->getEmail());
$uploadTokens = $this->getUploadTokens($client, $issue->get('attachments')
->getValue());
$bodyValue = $issue->get('body')->value;
if(!$bodyValue) {
$bodyValue = 'no text';
}
$remote_issue = $client->requests()->create([
'subject' => $issue->label(),
'comment' => [
'html_body' => $issue->get('body')->value,
'html_body' => $bodyValue,
'uploads' => $uploadTokens,
],
]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment