Post App Store news to a Slack channel
Make a Slack incoming webhook, save its address in your Team's Passwords, and have an Agent post App Store news to the channel, when you ask or on a Schedule.
An Agent can post a message to a Slack channel for you: a build is ready for testers, a version was approved, how the week’s ratings went. It posts through a Slack incoming webhook, an address Slack makes for one channel. You make the webhook in Slack, save its address in your Team’s Passwords, and ask.
Make the webhook in Slack
In Slack, you create a Slack app for your Slack workspace, turn on its incoming webhooks, add a webhook for the channel you want, and copy the webhook’s address. Slack walks through it in Sending messages using incoming webhooks ↗.
The address starts with https://hooks.slack.com/ (or https://hooks.slack-gov.com/ for Slack’s government workspaces). Slack’s page says it contains a secret and asks you not to share it.
Each webhook posts to the channel it was made for. For another channel, make another webhook.
Save the address in Passwords
The Agent reads the address from your Team’s Passwords with password-book and passes it straight to asc notify slack, so it doesn’t sit in the chat. There are two ways to save it:
- When the Agent asks, it posts a card for a login to save, with a box for the address. Paste the address and tap Submit. The value goes to the Team’s Passwords, not into the chat. See Save logins for Agents.
- To save it yourself before you ask, open Settings, then your Team, then Passwords, and tap Add Password. Type a Title, such as “Slack releases webhook”, paste the address into Password, and tap Save. Then tell the Agent the title. See Save logins for Agents.
Post a message
Ask in the Project’s chat, for example:
Post in Slack with the webhook saved as "Slack releases webhook": version 1.2 of Notes is approved and ready for release.- The Agent reads the address from Passwords.
- It posts with
asc notify slack, with your words as the message. - When Slack takes it, the command prints “Message sent to Slack successfully”, and the Agent tells you in the chat. Look in the channel.
The Agent can check App Store Connect first and put what it finds in the post. For where a release stands, it has asc status, a release dashboard for one app (see asc: review and release).
What a post can have
| What | asc notify slack |
|---|---|
| Text | --message. Every post has it. When the post has a layout, this is the text Slack falls back on. |
| Fields such as the app, version and build | --payload-json or --payload-file, with --pretext for a line above them, and --success false to mark them as a failure. |
| A layout made with Slack’s Block Kit | --blocks-json or --blocks-file. |
| A reply in a thread | --thread-ts, the timestamp of the message to reply to. A webhook answers a post only with “ok”, so the Agent can’t get it from its own posts: it comes from Slack. |
| Another channel | --channel. Slack may ignore it for incoming webhooks, so make a webhook for each channel instead. |
Post news as it happens
Agents don’t hear about new builds or approvals on their own: AirBuild sends those to people as notifications. So to tie posts to what happens on the App Store, make them part of the work you ask for:
Upload the new build to TestFlight, and post in Slack with the "Slack releases webhook" when it's ready for testers.Or give the Agent a Schedule, so it checks and posts on a timetable without being asked:
Every weekday at 9, check where Notes stands in App Store Connect and post a short update in Slack with the "Slack releases webhook". Don't post if nothing changed.You can add the Schedule yourself on the Agent’s Schedules, or ask the Agent to add it, as above. See Schedule work for an Agent.
If something goes wrong
The Agent says --webhook is required.
The Agent says the webhook must be a valid Slack webhook URL.
https:// address on hooks.slack.com or hooks.slack-gov.com, with nothing after a ? or #. Copy the webhook’s address from Slack again and save it in Passwords.The Agent says Slack gave an unexpected response.
no_service means the webhook is turned off, removed or invalid, and channel_is_archived means the channel was archived. See Sending messages using incoming webhooks ↗.The post went to the wrong channel.
--channel. Make a webhook for the channel you want and save its address under another title.