Hi,
I've found a method in documentation
GET /rest/api/2/project/search
that returns all projects with some fields like
"maxResults": 2, "startAt": 0, "total": 7
that can help me with pagination inside my mobile app.
But whenever i try to get a list of my projects i got response like this
{
"errorMessages": ["No project could be found with key 'search'."],
"errors": {}
}
It seems to me like jira api misleads
GET /rest/api/2/project/search
with
GET /rest/api/2/project/{projectIdOrKey}
and it expects project key instead of /'search'
Is there any explanation to this?
Regards,
Kamil
Currently i use
for fetching list of projects assigned to current user, but i noticed that this method is deprecated and documentation suggest to use
GET /rest/api/2/project/search
Could you give me example of url for fetching projects list using JQL? I cannot find it, all it refer is JQL queries for getting issues from specified project
Hi @kamil gronert,
Are you trying to use rest api for jira cloud or server? There are some APIs which are not available for the jira server, but available in jira cloud.
For example, this GET /rest/api/2/project/search api is available for the jira cloud, not the server. For jira cloud, it lists all the projects visible to the currently logged in user with pagination.
For jira server, the above rest call is treating as /rest/api/2/project/{ProjectKey}. That's why you are getting the error
{
"errorMessages": ["No project could be found with key 'search'."],
"errors": {}
}
To fetch all the projects visible to currently logged in user in the jira server, please use below rest call GET /rest/api/2/project. Unfortunately, with this rest call, you have to use your own pagination logic.
Hope this helps!
Thanks,
Santwana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your reply, now i understand everything :)
Cheers :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kamil,
/rest/api/2/project/search api searches for issues using JQL. You have to give query parameter for this rest call like this /rest/api/2/search?jql&startAt&maxResults&validateQuery&fields&expand.
As you have not given any query parameter, jira is taking the "/rest/api/2/project/search" api similar to /rest/api/2/project/{projectIdOrKey}.
For detailed information for /rest/api/2/project/search, please visit below link https://docs.atlassian.com/DAC/rest/jira/6.1.html#d2e4071
If you want to fetch the list of projects please refer to the below link.
Thanks,
Santwana
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.