How to fetch a Repository from HTTP Request for user repositories (repositories that don't have projects created)



The Atlassian API for fetching the repository using repository service is repositoryService.getBySlug(project, slug);

But, it could also be a user’s repository that does not have a project. Example

getBySlug API below fails because this repository does not have any project created for it.

public Repository getRepository(HttpServletRequest req){

        String pathInfo = req.getPathInfo();
        String[] components = pathInfo.split("/");
        return repositoryService.getBySlug(components[2], components[4]);

How to get the repository for users like “kshi”?

There is another API that gives the repository getById(int id). Here the id is the repository ID.
How to fetch the id using the HTTPRequest to further fetch the repository?


@pvandevoorde could you help here ?