Closed leoxhj closed 7 years ago
@leoxhj https://docs.stackstorm.com/mistral_yaql.html#other-yaql-functions
<% env().st2_execution_id %>
Please re-open issue if this isn't what you're looking for.
It will pass to external tool as reference id to find back in stackstorm if needed.
-------- 原始信息 -------- 由: Lindsay Hill notifications@github.com 日期: 2017/6/29 10:07 (GMT+08:00) 收件人: StackStorm/st2 st2@noreply.github.com 抄送: leoxhj leo_xhj@hotmail.com, Mention mention@noreply.github.com 主题: Re: [StackStorm/st2] Any detail docs describe how we can use result or stdout in workflow as reference (#3517)
I'm not quite sure why you want to access the execution id, but you can get it using st2_execution_id - go to https://docs.stackstorm.com/mistral_yaql.html and search for execution_id
I'm not quite sure what you need it for though. What are you trying to achieve here?
― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/StackStorm/st2/issues/3517#issuecomment-311842083, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADHy2UdnpjQ-cq27C5FvMib2XhbsHwcWks5sIwb3gaJpZM4OE8NX.
I have an Ansible action in the st2 mistral workflow and would like to post the action output into chatop.post_result action. To post the action result in chatops_post_result it required execution id. Would there be possible to get the execution id for the ansible action and assign that execution id into chatops.post_result action?
I've tried to use <% env().st2_execution_id %> with chatops.post_message however it returns the workflow execution id rather than the particular action ID.
example: post_chat_fail:
action: chatops.post_message
input:
channel: <% $.channel %>
message: "Auto-remediation failed for <% env().st2_execution_id %>"
Have you tried <% env().st2_action_execution_id %>? Just my guess, docs mentioned less details about environment()
发送自我的三星盖乐世智能手机。
-------- 原始信息 -------- 由: sibirajal notifications@github.com 日期: 2017/7/5 19:52 (GMT+08:00) 收件人: StackStorm/st2 st2@noreply.github.com 抄送: leoxhj leo_xhj@hotmail.com, Mention mention@noreply.github.com 主题: Re: [StackStorm/st2] Any detail docs describe how we can use result or stdout in workflow as reference (#3517)
I have an Ansible action in the st2 mistral workflow and would like to post the action output into chatop.post_result action. To post the action result in chatops_post_result it required execution id. Would there be possible to get the execution id for the ansible action and assign that execution id into chatops.post_result action?
I've tried to use <% env().st2_execution_id %> with chatops.post_message however it returns the workflow execution id rather than the particular action ID.
example: post_chat_fail:
action: chatops.post_message input: channel: <% $.channel %> message: "Auto-remediation failed for <% env().st2_execution_id %>"
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/StackStorm/st2/issues/3517#issuecomment-313081192, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADHy2d2DZynln9sRKAS4C6bRUHPOwy8hks5sK3kNgaJpZM4OE8NX.
That's right. I've tried <% env().st2_action_execution_id %> in my workflow and it failed with error. Basically I would like to get the execution id of the particular action and use that id for chatops.post_result action.
YaqlEvaluationException: Can not evaluate YAQL expression [expression=env().st2_action_execution_id, error=u'st2_action_execution_id', data={}] ] (execution_id=4768477e-b748-4f54-893a-47f2cd479317): YaqlEvaluationException: Can not evaluate YAQL expression [expression=env().st2_action_execution_id, error=u'st2_action_execution_id', data={}]
Dear support,
Not sure if this is correct or possible way (maybe the current action_execution_id is not known to workflow?), sometimes, the python script might want to know the action execution id as its input parameters. for instance, below action need current action_execution_id as its input parameter, can I know how to write the reference, like
{{result.id}}
or{{result.stdout.id}}
or{{action_context.id}}
?, I noticed the code part for each action from webui, but just don't know the exactly format to invoke in workflow definition file.BR, Leo