Creation "profile"-like selection variable with Extended Choice plugin

19 views
Skip to first unread message

Sergii Kholod

unread,
May 14, 2018, 1:03:32 PM5/14/18
to Jenkins Users
Hi All,

I need to store several named "profiles" for Jenkins job. So a user will choose human readable name but I need to get 3 properties for it in the jobs.
I've configured extended job plugin based "JSON Parameter" and realted groovy script to return an array of such presets:

Enter code here...import org.boon.Boon

def data_def = '''{
disable_edit_json: true,
disable_properties: true,
no_additional_properties: true,
disable_collapse: true,
disable_array_add: true,
disable_array_delete: true,
disable_array_reorder: true,
theme: "bootstrap2",
iconlib: "fontawesome4",
schema: {
"title": "URs",
"type": "array",
"format": "tabs",
"items": {
"title": "UR",
"headerTemplate": "{{self.Name}}",
"type": "object",
"properties": {
"Name": {
"type": "string",
"propertyOrder": 1
},
"ID": {
"type": "integer",
"propertyOrder": 2
},
"Definition": {
"type": "string",
"format": "xml",
"propertyOrder": 3
}
}
}
},
startval: [{
"Name": "UR1",
"ID": 1,
"Definition": "<Prefectures><Prefecture><Code>1</Code></Prefecture></Prefectures>"
},
{
"Name": "UR2",
"ID": 2,
"Definition": "<Prefectures><Prefecture><Code>2</Code></Prefecture><Prefecture><Code>3</Code></Prefecture><Prefecture><Code>5</Code></Prefecture></Prefectures>"
}]
}'''

def jsonEditorOptions = Boon.fromJson(data_def)

And it shows this structure as desired but it returns full JSON structure inside the job on submit. Not "selected" array member.
Does anyone know how to filter only selected part of the result?
Thanks!


Reply all
Reply to author
Forward
0 new messages