The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter when using GET /rest/api/2/project/search?

Lara Gonzalez Villanueva
January 2, 2020

Hi, 

I'm using the api GET /rest/api/2/project/search with Python for getting a list of projects. I would like to filter by projectTypeKey, projectCategory or even searching the name of the project in like... But I do not know exactly how to do it or if it is even possible.

Could you help me? This is the code that I'm using:

 

connection_params = get_connection_params(pard, data)

url = '%s/rest/api/2/project/search' % connection_params['url']

params = {
'jql': 'name ~ "myText" AND projectCategory in ("category1", "category2") order by lastViewed DESC',
'projectTypeKey': 'software',
'fields': '[key, summary, description]',
'maxResults': '100',
}
response = requests.get(url=url,
auth=connection_params['auth'],
proxies=connection_params['proxy'],
headers=connection_params['headers'],
params=params)

 Thank you!

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 2, 2020

Hi @Lara Gonzalez Villanueva 

If you use the v3 API you are able to pass in filter parameters which should help you.