Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,462,301
Community Members
 
Community Events
176
Community Groups

jira API V3 get projects - how to specify properties to return

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?

2 answers

1 accepted

1 vote
Answer accepted

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"
  }
}

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.

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'

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events