Skip to content

Unable to assign issues to myself via --add-assignee @me or --add-assignee USERNAME #6235

Description

@jtracey93

Describe the bug

Unable to assign issues to myself via --add-assignee @me or --add-assignee USERNAME

gh version 2.15.0 (2022-09-06)

Steps to reproduce the behavior

  1. gh issue edit https://github.com/Azure/Enterprise-Scale/issues/1035 --add-assignee '@me'
  • Result: 'jtracey93' not found
  1. gh issue edit https://github.com/Azure/Enterprise-Scale/issues/1035 --add-assignee 'jtracey93'
  • Result: 'jtracey93' not found
  1. gh issue edit https://github.com/Azure/Enterprise-Scale/issues/1035 --add-assignee 'anotherUserNameThatsNotMe'
  • Result: Works as expected ✅

Expected vs actual behavior

Able to assign issues to myself via gh cli

Activity

  1. mislav commented on Sep 12, 2022

    @mislav
    Contributor

    Hi, thank you for reporting. GitHub CLI resolves your username to an assignee ID by doing a lookup in the context of "assignable users". I was able to pull down the list of assignable users for this repository, which is massive, and indeed your username isn't among them:

    # warning: slow
    gh api graphql -f query='query($endCursor:String){repository(owner:"azure",name:"enterprise-scale"){assignableUsers(first:100,after:$endCursor){nodes{login}pageInfo{endCursor,hasNextPage}}}}' --paginate --jq '.data.repository.assignableUsers.nodes[].login' | tee assignable-azure.txt

    I think resolving usernames through assignableUsers is only viable for smaller orgs, but not for orgs of the size of Azure. I think GitHub CLI should switch to resolving a username directly, rather than trying to look it up in a large preloaded collection, which is also slow.

    Ref. #4876

  2. added
    priority-1Affects a large population and inhibits work
    and removed on Sep 12, 2022
  3. jtracey93 commented on Sep 12, 2022

    @jtracey93
    Author

    Thanks for getting back to me @mislav.

    Im an admin on this repo and can be assigned issues manually in the web interface?

    I do agree on your proposal though and am happy to test when there is a release available, just let me know

    Thanks

    Jack

  4. Shion1305 commented on Jun 19, 2023

    @Shion1305
    Contributor

    I suppose this issue has already been solved. It seems that version with the head of branch trunk works perfectly fine now with gh issue edit --add-assignee @me

  5. samcoe commented on Jun 20, 2023

    @samcoe
    Contributor

    @Shion1305 Not exactly. This feature works properly for small organizations but still does not work for large ones with many assignableUsers. We have a WIP PR to address this issue though.

  6. added
    coreThis issue is not accepting PRs from outside contributors
    on Jun 20, 2023
  7. ChrisSidebotham commented on Feb 19, 2024

    @ChrisSidebotham

    +1

    @samcoe - Any updates on the WIP PR. We are also experiencing this issue with our issue automation on Azure/bicep-registry-modules

  8. tony-box commented on Feb 29, 2024

    @tony-box

    Also +1 this. Happened to me in the bicep-registry-modules project that @ChrisSidebotham posted above.

  9. rahalan commented on Mar 2, 2024

    @rahalan

    +1, also Bicep registry repo

  10. 1 remaining item

  11. ChrisSidebotham commented on Apr 11, 2024

    @ChrisSidebotham

    Opened GH Support ticket to track this also

  12. andyfeller commented on Apr 16, 2024

    @andyfeller
    Contributor

    @ChrisSidebotham : Let me catch you up but the short of it is that

    1. mislav no longer works at GitHub, so any time he can spare from supporting other OSS projects is welcome but don't expect it.
    2. As you can see in issue edit: avoid race conditions when editing assignees, reviewers #4876, this involves reworking the underpinnings of how assignees for issues and PRs are handled.
    3. The team is open to PRs from the community given our current understaffed situation.

    Is this something you might be able to contribute?

  13. ChrisSidebotham commented on Apr 16, 2024

    @ChrisSidebotham

    Hi @andyfeller - I could try look or find someone with a suitable skillset, @jtracey93 for awareness.

  14. wingleung commented on May 1, 2024

    @wingleung
    Contributor

    @ChrisSidebotham If no one on your side is assigned to it, I'm willing to work on it. I had a look, and a lot can be reused from mislav's #4876
    I think editable_http.go might be better suited in https://github.com/cli/cli/tree/trunk/api but that's for another issue/PR

  15. ChrisSidebotham commented on May 2, 2024

    @ChrisSidebotham

    @wingleung - If you can contribute that would be great - we are struggling to find availability currently

  16. wingleung commented on May 2, 2024

    @wingleung
    Contributor

    @Shion1305 Not exactly. This feature works properly for small organisations but still does not work for large ones with many assignableUsers. We have a WIP PR to address this issue though.

    @samcoe I revived mislav's old PR and updated it to the current version, unfortunately I don't have an organisation as big as the azure one 😅 is this something that can be tested on github's side or by @jtracey93 ?

    I think this PR could already be tested for this ticket. but the functionality requested in #4844 should probably be a follow up to support team_reviewers nvm, added a commit for that 👉 #4844 (comment)

  17. ChrisSidebotham commented on May 8, 2024

    @ChrisSidebotham

    @Shion1305 Not exactly. This feature works properly for small organisations but still does not work for large ones with many assignableUsers. We have a WIP PR to address this issue though.

    @samcoe I revived mislav's old PR and updated it to the current version, unfortunately I don't have an organisation as big as the azure one 😅 is this something that can be tested on github's side or by @jtracey93 ?

    I think this PR could already be tested for this ticket. but the functionality requested in #4844 should probably be a follow up to support team_reviewers nvm, added a commit for that 👉 #4844 (comment)

    I can always test where needed!

  18. wingleung commented on May 8, 2024

    @wingleung
    Contributor

    @ChrisSidebotham great! 🙏 the test case before merge would be:

    1. checkout the PR: gh pr checkout https://github.com/cli/cli/pull/9037
    2. build the cli, it will be in the bin/ folder (more info)
      • Unix-like systems: make
      • Windows: go run script/build.go
    3. run @jtracey93 's steps to reproduce from his original post, but instead of gh issue edit ... the command should point to your cli build PATH_TO_YOUR_CLI issue edit ...
      • where PATH_TO_YOUR_CLI is the path to your newly built cli binary, for example ../cli/bin/gh issue edit ...
  19. wingleung commented on May 8, 2024

    @wingleung
    Contributor

    I think I have an assumption, @jtracey93 is it possible that you need to be added to the microsoft/azure organisation in github? when I do a query with jtracey93 to see if anything comes back from the assignableUsers, I still don't get any results.
    whereas a query with your other colleague Springstone does return his node

    • 🚫 gh api graphql -f query='query { repository(owner: "Azure", name: "Enterprise-Scale") { assignableUsers(query: "jtracey93", first: 1) { nodes { login } } } }'
    • ✅ gh api graphql -f query='query { repository(owner: "Azure", name: "Enterprise-Scale") { assignableUsers(query: "Springstone", first: 1) { nodes { login } } } }'
    image

    if that's not it, I think we need to add admins to the assignableUsers as well, which is something that needs to change in the github api

  20. ChrisSidebotham commented on May 10, 2024

    @ChrisSidebotham

    Azure/bicep-registry-modules#1906 @wingleung - This looks to have resolved our pagination problem against the assignable users?

  21. wingleung commented on May 12, 2024

    @wingleung
    Contributor

    @ChrisSidebotham thank you for testing!

    The tool does pagination to get all the assignable users 👉 https://github.com/cli/cli/blob/trunk/api/queries_repo.go#L1107-L1119. This is a slow query but it doesn't mean it's the core cause of this bug.

    The repo you tested on (Azure/bicep-registry-modules) is different from the one that jtracey93 mentioned (Azure/Enterprise-Scale)

    • Azure/bicep-registry-modules: has 49 assignable users which includes jtracey93 and ChrisSidebotham
      👉 gh api graphql -f query='query($endCursor:String){repository(owner:"azure",name:"bicep-registry-modules"){assignableUsers(first:100,after:$endCursor){nodes{login}pageInfo{endCursor,hasNextPage}}}}' --paginate --jq '.data.repository.assignableUsers.nodes[].login' | tee assignable-azure-bicep.txt
    • Azure/Enterprise-Scale: has 1611 assignable users which doesn't include jtracey93 or ChrisSidebotham
      👉 gh api graphql -f query='query($endCursor:String){repository(owner:"azure",name:"enterprise-scale"){assignableUsers(first:100,after:$endCursor){nodes{login}pageInfo{endCursor,hasNextPage}}}}' --paginate --jq '.data.repository.assignableUsers.nodes[].login' | tee assignable-azure.txt

    As mentioned in #6235 (comment) the user just isn't defined in the assignable user list. So the question is why certain users are not included in the assignable users list, maybe there is something missing or overwriting in the syncing between the azure organisation and github? I don't have access to the internals of github's graphql, so if the issue is not resolved I think we'll need someone from github to take a further look at this from the internal side @andyfeller.

    To be sure about the fix, I think we should explore some more test cases if you (or your team) can make some time 😄 🙏

    Test case: reproducible error

    1. using the old cli
    2. try and add jtracey93 or yourself to an issue on Azure/Enterprise-Scale
      👉 gh issue edit https://github.com/Azure/Enterprise-Scale/issues/1035 --add-assignee 'jtracey93'
    3. assert result is a 'jtracey93' not found error

    Test case: fix

    1. using this PR build
    2. try and add jtracey93 or yourself to an issue on Azure/Enterprise-Scale
      👉 ../cli/bin/gh issue edit https://github.com/Azure/Enterprise-Scale/issues/1035 --add-assignee 'jtracey93'
    3. assert no error was thrown and jtracey93 was added as assignee

    Test case: same flow but in interactive mode

    1. using this PR build
    2. try and add jtracey93 or yourself to an issue on Azure/Enterprise-Scale
      👉 ../cli/bin/gh issue edit https://github.com/Azure/Enterprise-Scale/issues/1035
      👉 choose Assignees and use the autocomplete to type and choose jtracey93
    3. assert no error was thrown and jtracey93 was added as assignee

    Opened GH Support ticket to track this also

    It's possible I'm missing some information because I don't have insights into that ticket

  22. self-assigned this
    on Feb 6, 2026
  23. forivall commented on Apr 7, 2026

    @forivall

    With a recent version of gh (gh version 2.89.0 (2026-03-26)), I see the following:

    $ gh pr edit --add-reviewer @me
    GraphQL: Could not resolve user with login '@me'. (requestReviewsByLogin)
    

    Although it does have a different root cause than a large organization (this is in a small org), it is covered by the original description of this issue.

  24. BagToad commented on Apr 7, 2026

    @BagToad
    Member

    👋 @forivall, I think that is a different problem than this issue. I actually think this issue is fixed now with some rewrites we've done to the command recently.

    Could I trouble you to open a new issue for what you are describing please?

  25. added a commit that references this issue on Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsgh-issuerelating to the gh issue commandpriority-1Affects a large population and inhibits work

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions