StackStorm / StackStorm/st2

{{ env }} not usable

Open
#3,791 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation stale status:to be verified
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

I'm not sure if it's me doing stupid things or not undertanding how this all works, but...

Looking at the actions documentation, it looks like I should be able to use {{ env }} in my jinja expression, but this is actually failing:

---
description: T
enabled: true
entry_point: 't.sh'
name: t
runner_type: local-shell-script
parameters:
    t:
        type: "string"
        description: "T"
        required: true
        default: "action: {{ action_context }} execid: {{ env }}"
        position: 1
...

The t.sh script just echoes its given parameters

Results in this:

  stdout: '{u''trace_context'': {}, u''user'': u''stanley'', u''pack'': u''oiobuild''}'

What I want to do is use execution ID in a "notify" to let user have a back link to st2:

notify:
  on-success:
    message: "To find more details, go to: https://stackstorm.openio.io/#/history/{{ env.ST2_ACTION_EXECUTION_ID }}/general"

I didn't find any help in the doc, even if the env() one, from here looked promising...

What am I missing ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the built-in parameters section of the actions documentation and the action YAML example, then compare it with the Mistral Jinja env() documentation. Reproduce the default parameter and notify expressions using the shown local-shell-script action. Done means the supported syntax and the observed execution-ID behavior are reconciled in the implementation or documentation.

Written by the indexing model from the issue text.

Assessment

Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.