As it turned out, the challenge
slack_client.api_call("chat.postMessage", channel=self.channel, attachments=self.msg, as_user=True)
will appear to add the top layer { "attachments": ... } for you. Therefore, changing my self.msg is simple:
self.format = [{ "fallback": "%s, %s" % (self.jiraIssueObj.fields.summary, self.link), "pretext": "Detail summary for %s" % self.jiraIssueObj, "title": self.jiraIssueObj.fields.summary, "title_link": self.link, "text": self.jiraIssueObj.fields.description[0:self.maxSummary], #"color": "#7CD197", "mrkdwn_in": ["text", "pretext", "fields"] }]
without this outer shell { "attachments": ... } , the api was able to post the attached message as expected.
MrDuk
source share