Create Extended Choice Param, with 'JSON Parameter Type' as type. Name this param as CONFIG (important as the JSONEditor object is referenced with this name in code!) -------------------------------------- JSON Parameter Config Groovy Script: >>> import org.boon.Boon; def jsonEditorOptions = Boon.fromJson(/{ theme: "bootstrap3", iconlib: "foundation3", schema: {} }/); return jsonEditorOptions; <<< -------------------------------------- JSON Parameter Config Javascript: >>> var schemas_map = new Map(); schemas_map.set ('none', { theme: "bootstrap3", iconlib: "foundation3", show_errors: "always", disable_array_add: true, disable_array_delete: true, disable_array_reorder: true, disable_collapse: true, disable_edit_json: true, disable_properties: true, no_additional_properties: true, schema: { title: "Seed configurations", description: "", type: "object", properties: { SERVER_CONFIG_CHOICE: { type: "string", description: "Select config to edit and build", enum: ["custom", "bulk_unittests", "unittests_master", "unittests_audio", "unittests_media", "doxygen"], required: true }, SERVER_CONFIG_CUSTOM_TEXT: { type: "string", format: "textarea", description: "You can copy here your whole configuration in text form to be parsed and press TAB", options: { hidden: true } }, SERVER_CONFIG_TYPE: { type: "string", description: "Type of generated seed job, used to customize it's behaviour", enum: ["none", "unittests", "doxygen", "bulk_trigger"], required: true }, TRIGGER_SEED_STAGE3: { type: "string", description: "Choose in which situation seed stage3 should be triggered", enum: ["none", "cron", "webhook(push)", "webhook(push)+status", "webhook(tag)"], options: { enum_titles: ["disabled", "by cron schedule", "by Gitlab webhook", "by Gitlab webhook + publish build status", "by Gitlab webhook tag event"], }, required: true }, CRON_FOR_SEED_STAGE3: { type: "string", description: "Schedule configuration for stage3 job", required: true }, RECIPES_REPO: { type: "string", description: "Repo with build recipes", required: true }, RECIPES_BRANCH: { type: "string", description: "Branch in with recipes repo", required: true }, ROOT_RECIPES__SOURCE: { type: "array", format: "selectize", default: ["main_recipe", "doxygen" ], options: { hidden: true }, required: true }, ROOT_RECIPES: { type: "array", format: "selectize", description: "Root recipe(s) that should be built", enumSource: "source", watch: { source: "root.ROOT_RECIPES__SOURCE" }, required: true }, JOB_PREFIX: { type: "string", description: "Prefix for generated job names", required: true }, ENABLE_SNAPSHOT: { type: "boolean", format: "checkbox", description: "Enable creation of snapshot", required: true }, SNAPSHOT_REPO: { type: "string", description: "Repo for pushing a snapshot of recipes", required: true }, SERVER_CONFIG_DUMP: { type: "string", format: "textarea", description: "Dump of current config for copying purposes", options: { expand_height: true }, required: true } } } }); schemas_map.set ('unittests', { theme: "bootstrap3", iconlib: "foundation3", show_errors: "always", disable_array_add: true, disable_array_delete: true, disable_array_reorder: true, disable_collapse: true, disable_edit_json: true, disable_properties: true, no_additional_properties: true, schema: { title: "Seed configurations", description: "", type: "object", properties: { SERVER_CONFIG_CHOICE: { type: "string", description: "Select config to edit and build", enum: ["custom", "bulk_unittests", "unittests_master", "unittests_audio", "unittests_media", "doxygen"], required: true }, SERVER_CONFIG_CUSTOM_TEXT: { type: "string", format: "textarea", description: "You can copy here your whole configuration in text form to be parsed and press TAB", options: { hidden: true } }, SERVER_CONFIG_TYPE: { type: "string", description: "Type of generated seed job, used to customize it's behaviour", enum: ["none", "unittests", "doxygen", "bulk_trigger"], required: true }, TRIGGER_SEED_STAGE3: { type: "string", description: "Choose in which situation seed stage3 should be triggered", enum: ["none", "cron", "webhook(push)", "webhook(push)+status", "webhook(tag)"], options: { enum_titles: ["disabled", "by cron schedule", "by Gitlab webhook", "by Gitlab webhook + publish build status", "by Gitlab webhook tag event"], }, required: true }, CRON_FOR_SEED_STAGE3: { type: "string", description: "Schedule configuration for stage3 job", required: true }, RECIPES_REPO: { type: "string", description: "Repo with build recipes", required: true }, RECIPES_BRANCH: { type: "string", description: "Branch in with recipes repo", required: true }, ROOT_RECIPES__SOURCE: { type: "array", format: "selectize", default: ["main_recipe", "doxygen" ], options: { hidden: true }, required: true }, ROOT_RECIPES: { type: "array", format: "selectize", description: "Root recipe(s) that should be built", enumSource: "source", watch: { source: "root.ROOT_RECIPES__SOURCE" }, required: true }, JOB_PREFIX: { type: "string", description: "Prefix for generated job names", required: true }, ENABLE_SNAPSHOT: { type: "boolean", format: "checkbox", description: "Enable creation of snapshot", required: true }, SNAPSHOT_REPO: { type: "string", description: "Repo for pushing a snapshot of recipes", required: true }, VALGRIND_ENABLE: { type: "boolean", format: "checkbox", description: "Add Valgrind configuration to job", required: true }, SERVER_CONFIG_DUMP: { type: "string", format: "textarea", description: "Dump of current config for copying purposes", options: { expand_height: true }, required: true } } } }); schemas_map.set ('doxygen', { theme: "bootstrap3", iconlib: "foundation3", show_errors: "always", disable_array_add: true, disable_array_delete: true, disable_array_reorder: true, disable_collapse: true, disable_edit_json: true, disable_properties: true, no_additional_properties: true, schema: { title: "Seed configurations", description: "", type: "object", properties: { SERVER_CONFIG_CHOICE: { type: "string", description: "Select config to edit and build", enum: ["custom", "bulk_unittests", "unittests_master", "unittests_audio", "unittests_media", "doxygen"], required: true }, SERVER_CONFIG_CUSTOM_TEXT: { type: "string", format: "textarea", description: "You can copy here your whole configuration in text form to be parsed and press TAB", options: { hidden: true } }, SERVER_CONFIG_TYPE: { type: "string", description: "Type of generated seed job, used to customize it's behaviour", enum: ["none", "unittests", "doxygen", "bulk_trigger"], required: true }, TRIGGER_SEED_STAGE3: { type: "string", description: "Choose in which situation seed stage3 should be triggered", enum: ["none", "cron", "webhook(push)", "webhook(push)+status", "webhook(tag)"], options: { enum_titles: ["disabled", "by cron schedule", "by Gitlab webhook", "by Gitlab webhook + publish build status", "by Gitlab webhook tag event"], }, required: true }, CRON_FOR_SEED_STAGE3: { type: "string", description: "Schedule configuration for stage3 job", required: true }, RECIPES_REPO: { type: "string", description: "Repo with build recipes", required: true }, RECIPES_BRANCH: { type: "string", description: "Branch in with recipes repo", required: true }, ROOT_RECIPES__SOURCE: { type: "array", format: "selectize", default: ["main_recipe", "doxygen" ], options: { hidden: true }, required: true }, ROOT_RECIPES: { type: "array", format: "selectize", description: "Root recipe(s) that should be built", enumSource: "source", watch: { source: "root.ROOT_RECIPES__SOURCE" }, required: true }, JOB_PREFIX: { type: "string", description: "Prefix for generated job names", required: true }, ENABLE_SNAPSHOT: { type: "boolean", format: "checkbox", description: "Enable creation of snapshot", required: true }, SNAPSHOT_REPO: { type: "string", description: "Repo for pushing a snapshot of recipes", required: true }, SERVER_CONFIG_DUMP: { type: "string", format: "textarea", description: "Dump of current config for copying purposes", options: { expand_height: true }, required: true } } } }); schemas_map.set ('bulk_trigger', { theme: "bootstrap3", iconlib: "foundation3", show_errors: "always", disable_array_add: true, disable_array_delete: true, disable_array_reorder: true, disable_collapse: true, disable_edit_json: true, disable_properties: true, no_additional_properties: true, schema: { title: "Seed configurations", description: "", type: "object", properties: { SERVER_CONFIG_CHOICE: { type: "string", description: "Select config to edit and build", enum: ["custom", "bulk_unittests", "unittests_master", "unittests_audio", "unittests_media", "doxygen"], required: true }, SERVER_CONFIG_CUSTOM_TEXT: { type: "string", format: "textarea", description: "You can copy here your whole configuration in text form to be parsed and press TAB", options: { hidden: true } }, SERVER_CONFIG_TYPE: { type: "string", description: "Type of generated seed job, used to customize it's behaviour", enum: ["none", "unittests", "doxygen", "bulk_trigger"], required: true }, SERVER_CONFIGS__SOURCE: { type: "array", format: "selectize", default: ["unittests_master", "unittests_audio", "unittests_media"], options: { hidden: true }, required: true }, SERVER_CONFIGS: { type: "array", format: "selectize", description: "Select existing configs to be triggered in given order", enumSource: "source", watch: { source: "root.SERVER_CONFIGS__SOURCE" }, required: true }, SERVER_CONFIG_DUMP: { type: "string", format: "textarea", description: "Dump of current config for copying purposes", options: { expand_height: true }, required: true } } } }); var seed_configs = [] seed_configs.push ({"SERVER_CONFIG_TYPE":"none","TRIGGER_SEED_STAGE3":"none","CRON_FOR_SEED_STAGE3":"","RECIPES_REPO":"git@aaa:bbb.git","RECIPES_BRANCH":"","ROOT_RECIPES":"","JOB_PREFIX":"","ENABLE_SNAPSHOT":false,"SNAPSHOT_REPO":"git@aaa:snapshot.git","SERVER_CONFIG_CHOICE":"custom"}); seed_configs.push ({"SERVER_CONFIG_TYPE":"bulk_trigger","SERVER_CONFIGS":["unittests_master","unittests_audio","unittests_media"],"SERVER_CONFIG_CHOICE":"bulk_unittests"}); seed_configs.push ({"SERVER_CONFIG_TYPE":"unittests","TRIGGER_SEED_STAGE3":"webhook(tag)","CRON_FOR_SEED_STAGE3":"","RECIPES_REPO":"git@aaa:bbb.git","RECIPES_BRANCH":"master","ROOT_RECIPES":["main_recipe"],"JOB_PREFIX":"master","ENABLE_SNAPSHOT":false,"SNAPSHOT_REPO":"git@aaa:snapshot.git","VALGRIND_ENABLE":false,"SERVER_CONFIG_CHOICE":"unittests_master"}); seed_configs.push ({"SERVER_CONFIG_TYPE":"unittests","TRIGGER_SEED_STAGE3":"none","CRON_FOR_SEED_STAGE3":"","RECIPES_REPO":"git@aaa:bbb.git","RECIPES_BRANCH":"master","ROOT_RECIPES":["main_recipe"],"JOB_PREFIX":"audio","ENABLE_SNAPSHOT":false,"SNAPSHOT_REPO":"git@aaa:snapshot.git","VALGRIND_ENABLE":false,"SERVER_CONFIG_CHOICE":"unittests_audio"}); seed_configs.push ({"SERVER_CONFIG_TYPE":"unittests","TRIGGER_SEED_STAGE3":"none","CRON_FOR_SEED_STAGE3":"","RECIPES_REPO":"git@aaa:bbb.git","RECIPES_BRANCH":"master","ROOT_RECIPES":["main_recipe"],"JOB_PREFIX":"media","ENABLE_SNAPSHOT":false,"SNAPSHOT_REPO":"git@aaa:snapshot.git","VALGRIND_ENABLE":false,"SERVER_CONFIG_CHOICE":"unittests_media"}); seed_configs.push ({"SERVER_CONFIG_TYPE":"doxygen","TRIGGER_SEED_STAGE3":"none","CRON_FOR_SEED_STAGE3":"","RECIPES_REPO":"git@aaa:bbb.git","RECIPES_BRANCH":"master","ROOT_RECIPES":["doxygen"],"JOB_PREFIX":"DOXYGEN","ENABLE_SNAPSHOT":false,"SNAPSHOT_REPO":"git@aaa:snapshot.git","SERVER_CONFIG_CHOICE":"doxygen"}); var changed_configs = []; var special_fields = ['SERVER_CONFIG_CHOICE', 'SERVER_CONFIG_CUSTOM_TEXT', 'SERVER_CONFIG_DUMP']; // alias for accessing global variables var window = this; if ('myspace' in window == false) { // set initial values window.myspace = {}; window.myspace.values = seed_configs; window.myspace.current_config = 'custom'; window.myspace.current_schema = getSchema (window.myspace.current_config); // dump current config so user can copy/paste it refreshConfigDump(); console.log ('Creating new editor and replacing original one'); window.editor_CONFIG = editor; switchSchema(); } function getSchema (config_name) { for (item of window.myspace.values) { if (item.SERVER_CONFIG_CHOICE == config_name) { return schemas_map.get (item.SERVER_CONFIG_TYPE); } } }; function getNewSchema (config_name) { var item = window.editor_CONFIG.getValue(); return schemas_map.get (item.SERVER_CONFIG_TYPE); }; function getValue (config_name) { for (item of window.myspace.values) { if (item.SERVER_CONFIG_CHOICE == config_name) { return item; } } }; function getNewValue (config_name) { return window.editor_CONFIG.getValue(); }; function recreateJSONEditor() { window.editor_CONFIG.destroy(); window.editor_CONFIG = new JSONEditor (document.getElementById('editor_CONFIG_holder'), window.myspace.current_schema); window.editor_CONFIG.setValue (getValue (window.myspace.current_config)); // install onchange callback, once editor is ready window.editor_CONFIG.on ('change', onchange); }; function replaceEditorContent() { console.log ('replaceEditorContent():', window.editor_CONFIG.getValue()); document.getElementById ('editor_CONFIG_value').value = JSON.stringify (window.editor_CONFIG.getValue()); }; function getWarningText (text) { if (!text.includes ('