Set Option Value to Another Option Value

74 views
Skip to first unread message

Adam Buchinski

unread,
Mar 1, 2021, 9:30:40 AM3/1/21
to rundeck-discuss
Hey there everyone,

Looking to see if it's possible to have an option (controlled by a cascading remote option dropdown) refer to a different option in the job which is user populated and required, making them the same value.

I've currently got the list pointed to a json that reads as follows:

[
    {"name":"Standalone", "value":"${option.newStoreNbr.value}", "selected":"true"}
]

newStoreNbr is the option being populated by the user before the cascading option is selected.

I've tried with both ${option.newStoreNbr.value} and ${option.newStoreNbr} but they never seem to extrapolate to their referenced fields.

Anyone have any ideas?

rac...@rundeck.com

unread,
Mar 2, 2021, 12:27:48 PM3/2/21
to rundeck-discuss

Hi Adam,

It seems that rundeck can’t evaluate the option inside json files, you can suggest that improvement here. Also, I tried to create an inline-script step that modifies the JSON file with the option but Rundeck collects the value at the moment of executing the job, so, a (dirty) approach is to create a job that populates the JSON with the selection using jq tool like this:

contents="$(jq '.[].value = "@option.opt1@"' standalone.json)" && \
echo "${contents}" > standalone.json

And then run a job to select the previous selection with the modified json file.

Regards!

Reply all
Reply to author
Forward
0 new messages