login Signup

How do I use API to get list of stages in pipeline in the correct order?

I have a pipeline defined with five stages, that run in this order......

Build ==> Smoke Test Deploy ==> Smoke Test ==> Full Test Deploy ==> Full Test

When I try to use the API getStages, and process the stages from the returned XML, they are not in the correct order. This is what my code prints out:

Stage = Build Stage = Full Test Stage = Full Test Deploy Stage = Smoke Test Stage = Smoke Test Deploy

I am trying to determine in my code the name of the Final Stage of the pipeline. Is there a way to determine the final stage, or to get the list of stages in the correct order?

Thanks. - Troy

avatar image By troyklomp 34 asked Oct 02, 2018 at 08:47 PM
more ▼
(comments are locked)
10|750 characters needed characters left

1 answer: sort voted first

in the data returned, (XML or JSON), you will find an "index" tag.


Use it to sort your stages

avatar image By lrochette 5.9k answered Oct 03, 2018 at 09:58 PM
more ▼
(comments are locked)
avatar image lrochette Oct 03, 2018 at 09:58 PM

I think by default the API call will return the stages in the order they were created

10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question



asked: Oct 02, 2018 at 08:47 PM

Seen: 38 times

Last Updated: Oct 03, 2018 at 09:58 PM

Related Questions