Vineet Kumar
Vineet Kumar

Reputation: 143

Rest API in Jenkins to get the Pipeline (stages) information

I'm exploring the options to get the pipeline (stages) information in Jenkins through Rest API. We had a pipeline plug-in installed on Jenkins.

Any help on same is highly appreciated.

Upvotes: 14

Views: 18008

Answers (1)

Vasiliki Siakka
Vasiliki Siakka

Reputation: 1283

You can use this endpoint to get the pipeline runs:

https://github.com/jenkinsci/pipeline-stage-view-plugin/tree/master/rest-api#get-jobjob-namewfapiruns

Each run blob should contain the corresponding stages, so you can extract the stages of the latest run.

Upvotes: 23

Related Questions