Yaron Adler
Yaron Adler

Reputation: 522

Jenkins: Fetching the value of a JSON Extended Choice Parameter

I'm trying to use Extended Choice Parameter in my jenkins project - with the JSON option.

I've built a very nice JSON parameter "DestinationEnvironment", and I'm trying to get one of the its properties "DestinationServer" for the build step, but I'm not sure how I access the inner properties of it.

Will appreciate any help!

Upvotes: 1

Views: 5888

Answers (2)

user12876257
user12876257

Reputation: 1

{"DestinationEnvironment": "DestinationServer"}

Try this..

Upvotes: 0

mmeier
mmeier

Reputation: 11

The JSON Parameter feature for the Extended Choice Parameter is based on the https://github.com/jdorn/json-editor

So the groovy script should return a JSON object that corresponds to the "options" object referred to in json-editor

This can be parsed in a groovy script: http://groovy-lang.org/json.html

Upvotes: 1

Related Questions