I am now on an internship and need to connect the jira rest api and our website. The connection works and I have already collected the project versions.
the version list is very long. So I want to make sure that you only see 5 versions per page. By that I mean that if there are more than 5 items in the list, it will automatically create a new page with the rest of the list.
I've searched everywhere for an answer, but haven't been able to find anything yet. someone who has been able to find a tutorial or can explain themselves how it works.
btw i work in php.
The code i use to get the project versions
$items = [];
try {
$param = [
'startAt' => 0,
'maxResults' => 5,
'orderBy' => '-name',
];
$proj = new ProjectService();
$items = $proj->getVersionsPagenated('TEST', $param);
foreach ($items as $v) {
echo "<hr>";
var_dump($v->name, $v->self, $v->id, $v->releaseDate);
echo "<br>";
}
Hi,
Welcome to the community.
You could try to get all the project version in a list, then take the length of the list and if it's greater that 5 take the 5 first item send them to the first page and create other page for the rest of the list
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.