Hi!
There is a method "Get projects paginated"
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-search-get
with query parameter "properties", which should allow to specify properties to return:
properties
Array<StringList>
EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list.
I tried to use several approaches but each time I get the same results. Besides id and key I am also received name, avatarUrls, projectTypeKey and etc. Examples of my attempts:
1) curl --request GET \
--url 'https://dmitrdv.atlassian.net/rest/api/3/project/search?properties=id,key' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
2) curl --request GET \
--url 'https://dmitrdv.atlassian.net/rest/api/3/project/search?properties[]=id,key' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
How to properly use "properties"? could you give example?
Hello @dmitry dobryak
All the characteristics of the project, like the ID, key, name etc are not properties, they are the built-in values, that is why you aren't getting any additional results back in your search.
Have a look at the documentation for the Project Properties endpoint. There you will see how to use /rest/api/3/project/{projectIdOrKey}/properties to query what properties a project has.
Once you know what properties are available, they are what you can put in your project search request, like this:
https://dmitrdv.atlassian.net/rest/api/3/project/search?properties=searchRequests,jswSelectedBoardType
In the results returned, you'll see the expansion of the properties, like this:
"properties": {
"searchRequests": {
"ids": []
},
"jswSelectedBoardType": {
"jswSelectedBoardType": "scrum"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No problem @dmitry dobryak
If you think my answer was correct, please mark it as the correct answer so that next person who reads the thread will be able to refer to it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I realized that it is related to what should be returned inside "properties: {}" in response. And proper request will be :
curl --request GET \
--url 'https://dmitrdv.atlassian.net/rest/api/3/project/search?properties=name1,name2,name3' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
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.