Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition by untranslated name not working properly #27

Open
brutto opened this issue Nov 7, 2022 · 1 comment
Open

Transition by untranslated name not working properly #27

brutto opened this issue Nov 7, 2022 · 1 comment

Comments

@brutto
Copy link

brutto commented Nov 7, 2022

It is not duplication of #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 '' is not valid for this issue."],"errors":{}}.

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
            }
        }
@lesstif
Copy link
Owner

lesstif commented Nov 7, 2022

Hi @brutto sorry for the late reply.

Could you make the PR for this case, please?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants