Error dereferencing key from workflow

I have a key that was created by had by logging into the st2client instance and doing the following:

st2 key set jenkins_role_id “xxx”

In my workflow.yaml file, I reference it like this:

vars:

  • credentials:
    jenkins_app_role:
    role_id: “{{ st2kv.system.jenkins_role_id }}”

When I test the associated webhook I get this error:

{
“output”: null,
“errors”: [
{
“type”: “error”,
“message”: “JinjaEvaluationException: Unable to evaluate expression ‘{{ st2kv.system.jenkins_role_id }}’. UndefinedError: ‘functools.partial object’ has no attribute ‘system’”
}
]
}

I can’t see what I’ve done wrong.

Take a look at StackStorm Runtime — StackStorm 3.3.0 documentation, I think you need to use the st2kv function e.g.
<% st2kv('system.jenkins_role_id) %>