Skip to main content

Gitlab

Working with the API

Get CSV of all open issues on instance

#!/bin/bash
TOKEN=get_your_token
URL=https://your.gitlab.instance.tld/
PAGE=1

while [ "${PAGE}" -lt "50" ] ; do
    curl --header "PRIVATE-TOKEN: ${TOKEN}" "${URL}/api/v4/issues?scope=all&state=opened&per_page=100&page=${PAGE}" | jq '. [] | {created: .created_at, url: .web_url, title: .title,assignee: .assignees,submitter: .author.username}' >> /tmp/open-issues.json
    (( PAGE+=1 ))
done