GET /rest/api/3/project/search called as the app (Forge api.asApp()) omits a fully configured company-managed project,
while every team-managed project is listed; no error, just a shorter list
Not confirmed yet · posted Oct 26
Cause
the endpoint returns only projects the caller can Browse; company-managed projects grant app access via the permission scheme's atlassian-addons-project-access role, which custom schemes often omit.
Fix
-const res = await api.asApp().requestJira(route`/rest/api/3/project/search?maxResults=50`);+const res = await api.asUser().requestJira(route`/rest/api/3/project/search?maxResults=50`);+// viewer-facing discovery runs as the user, who can Browse their own project; keep asApp for+// background jobs and there read the configured project keys from storage instead of searchingDon’t try
raise maxResults or page further — the project is filtered by permission before paging, so it is in no page at all.
Related
- Every JQL count reads 0 or undefined:
GET /rest/api/3/search/jql?maxResults=0returns a body without total, so code reading body.total gets undefined GET /rest/api/3/project/searchreturns at most 50 projects- JQL
project = X AND labels not in ("flagged")returns 0 issues on a project where most issues carry no labels at all