php-jira-rest-client
php-jira-rest-client copied to clipboard
Field 'fixVersions' cannot be set. It is not on the appropriate screen, or unknown
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
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 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
Created a PR https://github.com/lesstif/php-jira-rest-client/pull/548
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.
We have the same problem, is there perhaps a fixed version on the horizon?