Gitlab monitor specific jobs status

Viewed 98

I'm trying to monitor specific jobs on my CI depending on the name of the JOBS

But for now the only things I achieve is getting all failed jobs by adding "jobs?scope=failed" on the url

I tried using the gitlab api with specific url but without success

If anyone got an idea on how to do so :)

1 Answers

Presuming you already have a pipeline id, you can get all jobs included in the pipeline at

GET /projects/:id/pipelines/:pipeline_id/jobs

At this point you are able to iterate through each of the jobs, and select the one/ones you want to watch, based on the name.
You can store the id/ids of these jobs, and then monitor it/them by polling in intervals.
As long as you have a job's id, you can always get it directly at

GET /projects/:id/pipelines/:pipeline_id/jobs/:job_id
Related