dont do a nested chain
@@ -8,15 +8,23 @@ chain:
source_channel: "{{channel}}"
text: "{{text}}"
publish:
- execution_id: "{{format_execution_result.result}}"
- on-success: "post_result"
+ execution_id: "{{match_and_execute.result}}"
+ on-success: "format_execution_result"
-
- name: "post_result"
- ref: "chatops.post_result"
+ name: "format_execution_result"
+ ref: "chatops.format_execution_result"
+ parameters:
+ execution_id: "{{execution_id}}"
+ publish:
+ message: "{{format_execution_result.result.message}}"
+ extra: "{% if 'extra' in format_execution_result.result %}{{format_execution_result.result.extra}}{% else %}{}{% endif %}"
+ on-success: "post_message"
+ -
+ name: "post_message"
+ ref: "chatops.post_message"
parameters:
user: "{{user}}"
channel: "{{channel}}"
whisper: "{{whisper}}"
message: "{{message}}"
extra: "{{extra}}"
\ No newline at end of file
- execution_id: "{{execution_id}}"
\ No newline at end of file
