Forums

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

The environments rest API returns an invalid `next` URL when there are more than 10 envs

Daniel Alfaro public
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 21, 2023

The environments API is returning an odd `next` URL when a repo has more than 10 environments.  This breaks code that is automatically requesting the next URL since it thinks that there are more pages.

 

The response looks like this

```

{

  "page": 1,

  "values": [...],

  "size": 14,

  "next": "http://bitbucket-pipelines.prod.public.atl-paas.net/rest/2.0/accounts/%7B39491fc4-9d08-4885-af60-ad04b4ae7cdb%7D/repositories/%7Bfc0ed7bb-d56a-4e84-b369-9e68a117d2a6%7D/environments?page=2&pagelen=10",

  "pagelen": 14

}

```

 

Attempting to request the URL will result in a 403

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 25, 2023

Hi Daniel and welcome to the community.

We have an open bug report about this issue here:

Our development team will post an update on that ticket when this is fixed. Please note that we don't provide ETAs and bug fixing is implemented as per our policy here.

You can add yourself as a watcher (by selecting the Start watching this issue link in the bug report) if you'd like to get notified via email on any updates. You can also select This affects my team to indicate you are affected by this issue.

In the meantime, the only workaround would be to ignore the "next" parameter for this endpoint since the response will show all environments on one page.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events