get the list of project order by projectID in jira?

Anandhakrishnan May 12, 2021

Hi , I  have created more than 30 projects in my jira account . i have few doubt to get the list of projects in jira.

1. is it any limitation to retrive all the projects in jira.

2. is getting the projects order by project ID?

3. is any possible to get the list of project that is greater than the specified projectID or key?

 

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 12, 2021

What do you mean by "get" (in "get list of projects")?

Anandhakrishnan May 13, 2021

get means i want to retrieve the list of projects in my jira account.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 13, 2021

"retrieve" is a synonym for "get" in that context.  It does not explain what you mean by "get"

The reason I'm asking you to explain "get" is that there is an obvious answer: You can "get" a list of projects by going to the list of projects in the UI and reading it. 

I don't think that's what you mean.  It's the correct answer because you are "getting" or "retrieving" the list, but I don't think you want that.

Anandhakrishnan May 23, 2021

I am asking,I need to retrieve list of created jira projects into my application based on orderBy projectid asc order.Is that possible?And also I need to ask,can I get project created date?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2021

Repeating "retrieve" does not explain it.  What do you mean by "get"?  "Into my application" helps a little bit, but still does not explain what you are trying to do.

Jira does not record project creation dates, so no, whatever you're doing, you won't be able to "get" that.

Anandhakrishnan May 24, 2021

I am using third party application, and I  integrated jira into my application using Rest API.Whenever I create project in jira, I need to save into my application database(I know webhook is available for this but I need to get using url request).Using this url https://your-domain.atlassian.net/rest/api/3/project/search ,I used Rest API to get projects.Using the above url Jira can retrieve only (maxResults=50) 50 projects at a time with paginated.

 1) Is there any possibility to get all the projects at a time  of single request?

 2) Is there any jql query to get jira projects based on project id in any order?

3) Also,can you list the availble assignment operator used in projects(like https://your-domain.atlassian.net/rest/api/3/search?jql=project>10069 )?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2021

Ah, ok, so you already have a "get", and are doing it the right way, so that's not actually the question.

So, the actual questions are:

1) No, you have to go through the pagination.  It's there to stop overloading the api.

2) JQL finds issues, not projects, so no.  There is no project search at all.

3) I do not understand "assignment operator" - what does this mean?  What are you trying to ask of the project?

Anandhakrishnan May 24, 2021

Thank you very much,

I'm saying I can list project in descending order based on the name of the project using this url - https://<domain>.atlassian.net/rest/api/3/project/search?orderBy=-name.

But I need to list project in descending order based on project id.If I use the below url, https://<domain>.atlassian.net/rest/api/3/project/search?orderBy=-id  ,I get an error like this:

{"errorMessages":["The field to order by should be one of [name, key, owner, category, issueCount, lastIssueUpdatedTime, archivedDate, deletedDate]. Instead, it was: id."],"errors":{}}

So my question is, Is there any possible to list project in descending order based on project id?

Anandhakrishnan May 25, 2021

Assignment Operator means (>,<,=,..)I'm asking Can I list projects greater than particular project id.For example, 3 projects in jira whose id's are 10000,10001,10002.If  I pass 10000 in rest api I need to list 10001 and 10002.

I tried this url https://your-domain.atlassian.net/rest/api/3/search?jql=project>10000 but got an error.

Suggest an answer

Log in or Sign up to answer