Managing issues via the API
One of the most used features in the GitLab API is the creation and listing of issues for a given project. In this recipe, we will take a look at how you can incorporate this into your own workflow.
Getting ready
You need to have your own private_token
present, as every call needs this. We will be creating issues for a project, which means that you also need to have at least one project in your GitLab instance.
How to do it…
Let's start by getting the
project_id
field for which we want to create the issue. You can do this by entering thehttp://example.com/api/v3/projects?private_token=your_token
endpoint in Postman. This will give you a JSON output of all your projects. Just pick one for which you want to create some issues and note the ID.Now that we have the
project_id
field, we can create a new issue via the API. The endpoint requires a few necessary fields, which are theproject_id
field and the title of the issue.To create the actual issue, you need to enter...