diff --git a/src/Issue/IssueService.php b/src/Issue/IssueService.php index 28e1a46..0aec539 100644 --- a/src/Issue/IssueService.php +++ b/src/Issue/IssueService.php @@ -1154,12 +1154,16 @@ public function getIssueSecuritySchemes($securityId) public function updateLabels($issueIdOrKey, $addLablesParam, $removeLabelsParam, $notifyUsers = true) { $labels = []; - foreach ($addLablesParam as $a) { - array_push($labels, ['add' => $a]); + if ($addLablesParam !== null) { + foreach ($addLablesParam as $a) { + array_push($labels, ['add' => $a]); + } } - foreach ($removeLabelsParam as $r) { - array_push($labels, ['remove' => $r]); + if ($removeLabelsParam !== null) { + foreach ($removeLabelsParam as $r) { + array_push($labels, ['remove' => $r]); + } } $postData = json_encode([ @@ -1192,12 +1196,16 @@ public function updateLabels($issueIdOrKey, $addLablesParam, $removeLabelsParam, public function updateFixVersions($issueIdOrKey, $addFixVersionsParam, $removeFixVersionsParam, $notifyUsers = true) { $fixVersions = []; - foreach ($addFixVersionsParam as $a) { - array_push($fixVersions, ['add' => ['name' => $a]]); + if ($addFixVersionsParam !== null) { + foreach ($addFixVersionsParam as $a) { + array_push($fixVersions, ['add' => ['name' => $a]]); + } } - foreach ($removeFixVersionsParam as $r) { - array_push($fixVersions, ['remove' => ['name' => $r]]); + if ($removeFixVersionsParam !== null) { + foreach ($removeFixVersionsParam as $r) { + array_push($fixVersions, ['remove' => ['name' => $r]]); + } } $postData = json_encode([