This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

Value: <% st2kv( system.$.combinedKey ) %>

    vars:
        value: unspecified
        combinedKey: <% $.scope %>.<% $.key %>
    vars:
        value: unspecified
        combinedKey: <% $.scope %>.<% $.key %>

been running through the publish statement and trying to figure out how I get the variable $.st2_execution_id or env().st2_execution_id into the actual variable to be able to fetch it for the ‘st2kv’. While the below 'system.leastBusyBuildServer' works as expected, doing something like 'system.$.st2_execution_id.exit_status' doesn’t expand the variable and I get back

state_info: "Failed to handle action completion [error=Can not evaluate YAQL expression [expression=st2kv( system.$.combinedKey ), error=No function “#operator_.” matches supplied arguments, data={}], wf=examples.mistral-kv, task=task1, action=std.noop]:

    publish:
# fails               value: <% st2kv( <% $.scope%>.<% $.key %> ) %>
#  fails              value: <% st2kv( '$.combinedKey' ) %>
#  fails              value: <% st2kv( $.combinedKey) %>
#worked                value: <% st2kv( 'system.leastBusyBuildServer' ) %>
#fails                value: <% st2kv('system.$.st2_execution_id.exit_status' )

I have also tried this in the

    vars:
        last_exit_prep_all:  concat("'" , "st2_id" , "." , $.last_exit_prep, "." , "exit_status" , "'")
        st2_execution_id: <% env().st2_execution_id %>

publish:
                 exit_status_string: <% st2kv($.last_exit_prep_all) %>

also fails…

What’s the actual problem you’re trying to solve here?

this worked, struggling for too long… removing the single quotes solved this for me yeah!!

vars:
    value: unspecified
    combinedKey: <% $.scope %>.<% $.key %>
input:
   - key
   - scope
output:
    stdout: <% $.value %>
  
tasks:
    task1:
        action: std.noop
        publish:
            value: <% st2kv( $.combinedKey ) %>