lesstif / php-jira-rest-client

PHP classes interact Jira with the REST API.
Other
510 stars 263 forks source link

Assigning Issue by Account ID does not work #381

Closed Nessworthy closed 2 years ago

Nessworthy commented 3 years ago

In IssueField:

    public function setAssigneeAccountId($accountId)
    {
        if (is_null($this->assignee)) {
            $this->assignee = new Reporter();
        }

        $this->assignee->accountId = $accountId;

        // REST API V3 must name field set to null.
        $this->assignee->name = null;
        $this->assignee->setWantUnassigned(true);

        return $this;
    }

$this->assignee->setWantUnassigned(true); seems to be preventing assigning via account ID when using: $issue->setAssigneeAccountId($assigneeAccountId);

The workaround for now is to override it after setting the account id:

$issue->setAssigneeAccountId($assigneeAccountId);
$issue->assignee->setWantUnassigned(false);

If I have time tonight I'll throw up a MR.

lesstif commented 3 years ago

hi @Nessworthy . i 'm wait for your MR.

thanks!