php-JiraCloud-RESTAPI
php-JiraCloud-RESTAPI copied to clipboard
Transition by untranslated name not working properly
It is not duplication of https://github.com/lesstif/php-JiraCloud-RESTAPI/issues/15. Problem still exists. @lesstif
Previous issue was fixed partly: only for code syntax, not logic.
In doc for issue transition was said to use Transition::setUntranslatedName() method for "JIRA with local language profiles".
But if you use it transition id
calculated wrong. Instead of transition id
used status id
.
So you get errors like {"errorMessages":["Transition id '
Problem in IssueService::findTransitonIdByUntranslatedName
.
foreach ($transitionArray as $trans) {
if (strcasecmp($trans['name'], $untranslatedName) === 0 ||
strcasecmp($trans['untranslatedName'] ?? '', $untranslatedName) === 0) {
return $trans['id']; // <-- here
}
}
The core problem is about using status id
instead of using transition id
.
My workaround is (its not perfect and can be improved):
foreach ($transitionArray as $trans) {
if (strcasecmp($trans['name'], $untranslatedName) === 0 ||
strcasecmp($trans['untranslatedName'] ?? '', $untranslatedName) === 0) {
return $this->findTransitonId($issueIdOrKey, $trans['name']); /// <-- this is correct logic
}
}