php-jira-rest-client icon indicating copy to clipboard operation
php-jira-rest-client copied to clipboard

Field 'fixVersions' cannot be set. It is not on the appropriate screen, or unknown

Open uaoleg opened this issue 7 months ago • 6 comments

This error is caused by setting a default value for $fixVersions = [] https://github.com/lesstif/php-jira-rest-client/blob/main/src/Issue/IssueField.php#L50

And because of that it's not filtered out by !is_null https://github.com/lesstif/php-jira-rest-client/blob/main/src/Issue/IssueField.php#L117

uaoleg avatar Apr 29 '25 14:04 uaoleg

Hello, I have version 5.10 In our system there is no fixVersions field and we get an error: {"errorMessages":[],"errors":{"fixVersions":"Field 'fixVersions' cannot be set. It is not on the appropriate screen, or unknown."}}

Can you please add this code in jsonSerialize(), class IssueField

if (empty($this->fixVersions)) {
    unset($vars['fixVersions']);
}

DreamyDevil avatar May 07 '25 12:05 DreamyDevil

@DreamyDevil that code already exists https://github.com/lesstif/php-jira-rest-client/blob/main/src/Issue/IssueField.php#L117 What we need is to replace !is_null with !empty

uaoleg avatar May 07 '25 13:05 uaoleg

Created a PR https://github.com/lesstif/php-jira-rest-client/pull/548

uaoleg avatar May 07 '25 13:05 uaoleg

I think this error occurs in newer Jira versions. In our case, we needed this fix, and also this change: https://github.com/lesstif/php-jira-rest-client/pull/549 to make the integration work again.

johanib avatar May 15 '25 08:05 johanib

We have the same problem, is there perhaps a fixed version on the horizon?

SvenJuergens avatar Jun 02 '25 12:06 SvenJuergens