I have a task that for now publishes a variable (interface_field) that is a dict within a list
get_device_interface_info:
action: mypack.get_device_interface_info hostname=<% $.hostname %>
publish:
interface_stdout: <% task(get_device_interface_info).result.stdout %>
interface_field: <% list(dict('title'=> server1, 'value'=> test1, 'short'=> True)) %>
During the task I see the output as such
"interface_field": [
{
"short": "True",
"value": "test1",
"title": "server1"
}
]
But once that is called inside the alias (msg being sent to chatops/slack)
fields: "{{ execution.result.interface_field }}"
the output is not the same
"fields": "[{u'short': u'True', u'value': u'test1', u'title': u'server1'}]",
The reason I am doing this is because I can’t create a for loop to create each “fields” as this is the format being sent to slack
"extra": {
"slack": {
"attachments": [
{
"color": "#00AA00",
"text": "Host Details:",
"fields": [
{
"short": true,
"value": "test",
"title": "Hostname"
}
Have searched and tried many diff variations