Closed wivaku closed 2 years ago
Trying to add version to issueField, similar to the documentation. Using v4.0.3.
issueField
<?php require __DIR__ . '/vendor/autoload.php'; use JiraRestApi\Issue\IssueField; $issueField = new IssueField(true); $issueField // ->addComponentAsString('Component-1') // works fine ->addVersionAsString(['1.0.2']) // error 400 when updating (even though the version exists) ; $issueService = new IssueService(); $issueService->update( 'TEST-879', $issueField, ['notifyUsers' => false] ); // Error: CURL HTTP Request Failed: Status Code : 400, URL:https://xyz.atlassian.net/rest/api/2/issue/TEST-879?notifyUsers=0
The convenience wrapper updateFixVersions does work.
updateFixVersions
$ret = $issueService->updateFixVersions($issueKey, $addVersions, $removeVersions, $notifyUsers = false );
But the consequence is that I have to make two calls to update each ticket.
Hi @wivaku, Sorry for the late reply.
As you mentioned, IssueService's update method doesn't fit for a version updates. It may be inconvenient, you should use the updateFixVersions method.
Thanks!
Trying to add version to
issueField
, similar to the documentation.Using v4.0.3.
The convenience wrapper
updateFixVersions
does work.But the consequence is that I have to make two calls to update each ticket.