I am a site admin and trying to use the REST API to retrieve a list of projects. In the UI I am able to see and manipulate all projects/items. The REST API always returns 0 projects.
var jira = Jira.CreateRestClient("[App URL]", "[username]", "[password]", new JiraRestClientSettings() { EnableRequestTrace = true });
var yyy=jira.Projects.GetProjectsAsync().Result.ToList();
var response1 = jira.RestClient.ExecuteRequestAsync(RestSharp.Method.GET, $"/rest/api/3/project/search").Result;
var response2 = jira.RestClient.ExecuteRequestAsync(RestSharp.Method.GET, $"rest/api/2/project?expand=id,title&recent=10&includeArchived=true&browseArchive=true").Result;
I have tried the 3 ways above and all return successful but have no projects listed. I assume this is a permission issue but can not find what permission I might be missing. Since I am a Site Admin, I should have everything.
Hi @ericreiner
As @Hana Kučerová said, what code is returned? Is it an error code or success code?
Try a simple issue call like /rest/api/3/search or even /rest/api/3/search?jql=key=ABC-123 to just return one issue (where ABC-123 is an issue that you know you can see in Jira) - does this work?
The permission that you need to check, for each project, is
The tags for this question show as cloud, if correct your code is showing username and password. For cloud now, you should be using the Jira user's e-mail address and an API token, otherwise you would get an error relating to authorisation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @ericreiner ,
are you able to see issues in these projects?
Please, try to check "Browse Projects" permission.
https://confluence.atlassian.com/adminjiracloud/managing-project-permissions-776636362.html
Even thought you are Site Admin, it is possible, that you don't have access to the projects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am able to see issues, make changes, etc. I explicitly added Browse Projects to myself but I am still not getting any responses.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ericreiner
I just tried to get projects from my cloud instance using GET /rest/api/3/project/search.
(I used Postman application with basic authentication: username + api token.)
Everything worked fine for me.
Which response code did you get? (return successful = code 200?)
Was there any message in the response?
Is it possible to attach here the whole response you obtained?
Did you try to perform any other action (like "get issue") using REST API?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.