Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
Community showcase
Published in Marketplace Apps & Integrations

Staying organized with Jira: best practices for a better project management

Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...

237 views 2 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you