ITC app updates on Slack

Liliana Sousa
2 min readJan 30, 2018

--

For most of you this may be a bit useless but for me, that don’t have access to the company email on my phone but do have to company Slack, this is a very useful integration with Slack :)

So, as a start i downloaded Erik Villegas project on github — https://github.com/erikvillegas/itunes-connect-slack

It does pretty much all work but it’s made to work for only one app.

In my case, i wanted for several, in different teams.

Follows a description of what i needed to change.

Adapt the get-app-status.rb and poll-itc.js to make the work for more than one app

If for all apps, you can get all you application with

apps = Spaceship::Tunes::Application.all

and then iterate the code for each app bundle_id.

If you want just for 3 apps, probably easier to just replicate the code 3 times.

Set team in the beginning and switch team in the middle of the process (on get-app-status.rb)

After login is done, team can be set with property team_id.

spaceship = Spaceship::Tunes.login(<itc_username>)

spaceship.team_id=<team_id>

How do you get the team_id?

There’s a method that allows to switch team but it requires input from user. You can use it to see the existent team ids.

Spaceship::Tunes.select_team

The output for it will be something like

Multiple iTunes Connect teams found, please enter the number of the team you want to use:

1) “<Organization_Name1>” (<team_id1>)

2) “<Organization_Name2>” (<team_id2>)

3) “<Organization_Name3>” (<team_id3>)

But there’s an easier way to do it. Login to your ITC account in the browser, then open this link

https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail

This retrieves a JSON where you will be able to find all team ids — just search for the field contentProviderID.

Notify everyone in the channel

In post-update.js you will find this

var params = {

“attachments” : [attachment],

“as_user” : “true”

}

If as_user is true, your user will be the one posting to Slack, which means you won’t get notified. If you change it to false then the post owner becomes the Slack API.

Also, i wanted to add “@channel” on the message, so that everyone is notified.

If you simply add @channel to the message, Slack API won’t understand it. You need to add it as <!channel|channel>

That’s pretty much it!

You can now have this running constantly on a machine that never gets down, by simply running the script in background

node poll-itc.js > /dev/null 2>&1 &

Have fun ;)

--

--

Liliana Sousa

Addicted to tech, leadership, puzzles, challenges and having fun :)