Open nmaludy opened 6 years ago
As a temporary workaround, when https://github.com/StackStorm/st2/pull/4155 is merged, you could add explicit int
cast in the default value Jinja template.
I believe that should work, but not 100%.
Wondering if this affects other executions like rules/webhooks (we don't use those very often, so i haven't tested)?
@Kami Ran into this again and tried your suggestion, unfortunately it didn't work. It seems like it never tries to render the Jinja expression in the default when executed from an Alias.
@nmaludy Roger, will look into it and try to reproduce it when I get a chance.
ISSUE TYPE
STACKSTORM VERSION
OS / ENVIRONMENT / INSTALL METHOD
SUMMARY
When executing an
action-alias
that points to anaction
which contains a parameter ofarray
,object
, orinteger
type having a default value that reads from the datastore, the alias-execution fails. Executing the same action from the CLI viast2 run
works as expected.STEPS TO REPRODUCE
/opt/stackstorm/packs/default/actions/test_chatops_datastore_default.yaml
/opt/stackstorm/packs/default/actions/workflows/test_chatops_datastore_default.yaml
/opt/stackstorm/packs/default/aliases/test_chatops_datastore_default.yaml
Set data in datastore
EXPECTED RESULTS
ACTUAL RESULTS
Demo working from CLI
You can see here that i'm passing in no data, all parameters are being read from the datastore, and the action succeeds.
Demo broken from ChatOps
In this picture you can see my first command
test defaults
fails because the rendering/casting of the parameters doesn't work. However if i pass in all of the data everything is fine.Logs from /var/log/st2/st2api.log