Trying to figure out how to cycle through a huge json to just get the names
not sure why i keep getting groups_stdout is not type list
input:
- hostname
- args
- credential_name
- cmdlet_credential_name
tasks:
get_members_in_group:
action: activedirectory.get_ad_group_member hostname=<% ctx(hostname) %> args=<% ctx(args) %> credential_name=<% ctx(credential_name) %> cmdlet_credential_name=<% ctx(cmdlet_credential_name) %> output=json
next:
- when: <% succeeded() %>
publish:
- groups_stdout: <% result() %>
- stderr: <% result().stderr %>
do: send_slack_message
send_slack_message:
with:
items: name in <% ctx(groups_stdout) %>
action: chatops.post_message
input:
message: "---"
#can also work ctx(assignee_email).split('@')[0]
channel: "#development"
extra:
slack:
attachments:
- fallback: "Info %>"
color: "#00AA00"
title: "test"
title_link: "https://www.google.com"
fields:
- title: "test"
value: "<% items(name) %>"
#value: "<% ctx().groups_stdout.result.stdout %>"
short: false
next:
- when: <% succeeded() %>
publish:
- message_stdout: <% result() %>
output:
- groups_stdout: <% ctx().groups_stdout.result.stdout %>
- items: <% task(get_members_in_group).result.items.select($.result.stdout) %>