Assign bug from different repo when creating a pull request
There are actually many ways to link work items to other objects in Azure DevOps.  Microsoft's documentation is pretty extensive on this topic.  However, for the particular task at hand, linking code commits (I'll assume Git is in use for this example), can be done in several different ways.


In your commit message - By including the work item ID in the commit message prefixed with the hash mark # (i.e. #12345), when the commit is pushed to the server, the work item and commit are linked automatically.  Then, when this commit is part of a pull request that is created, the linkage is made visible as part of the pull request.
Within the pull request during creation, or afterward when edited by the creator, you can add work items directly to the pull request by searching either by ID or by keywords.
Several other methods can be discovered through editing a work item or right in Visual Studio.