I am trying to add `?fields=key,id` or `?limit=50` but the output seems unchanged. Can the projects list query output be leaned out or changed? Thanks
Hi @samfullman ,
Just to add to @Bill Sheboy's answer: The endpoint /rest/api/2/project is marked as deprecated in both Version 2 (current) as well as Version 3 (beta) of the Jira Cloud REST API.
If you want to be on the safe side for the future, you should use /rest/api/2/project/search (Get Projects paginated), which a) uses maxResults and b) is limited by default. It also supports expansion meaning, you can choose which attributes of a project to expand on.
Finally, if you really want to limit not the amount of projects returned, but rather limit which attributes are returned: That's not as easily done, but I would suggest looking into Jira Expressions. While they are geared towards issues instead of projects, you can dynamically load projects into the evaluation context using the new () syntax. Once you have done that, you should be able to select whatever attributes you want and return them.
Hope that helps,
Oliver
Hey Oliver, this is a concise answer.
A thought, unlike tickets, projects have a more or less finite limit (though my company shows 680 of them!) - it would be nice to call /rest/api/[2|latest]/project/search and just get everything - if that's possible
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @samfullman ,
I don't believe there's an out-of-the-box option, apart from the deprecated API call.
However, if you are not afraid of a little Javascript, you can use Atlassian's Forge platform to build your own custom REST endpoint to deliver exactly what you need. The way to do this would be with a so-called webtrigger module.
Even if that isn't for your company, it's always a good idea to learn Forge as Jira admin, even if you do not want to build your own apps. You can just as well use it to customize Jira cloud in ways that so far were only possible with scripting apps. They have a one-day virtual conference coming up about this, too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @samfullman
Please try maxResults as described here on the REST API information for Jira Cloud:
https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/
Kind regards,
Bill
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.