I know there is REST APIs to get all the projects that a user has access to (/rest/api/2/project). Is there a API that I can get all the projects which key/name starts with a certain string?
I had similar problem, so I wrote rest endpoint on my own. My endpoint gets all projects with name containing query.
@GET@Path("/jira-project")public Response findAllJiraProjects(@QueryParam("query") final String query) { final List<Project> projects = projectManager.getProjectObjects(); final List<Project> result = projects.stream() .filter(project -> project.getName().toLowerCase().contains(query.toLowerCase())) .collect(Collectors.toList()); return Response.ok(result).build();}
But if there is relatively small amount of projects in Jira meybe better solution is to use Jira endpoint (/rest/api/2/project) and filter data afterwards.
It looks like you're new here. Sign in or register to get started.