No installation ID when moving from Connect to Forge

I’m moving some Connect apps to Forge. We’ve been using Atlassian Connect Spring Boot. Our DB tables are keyed off of client key, and I understand that Forge installation ID is the new one.

My problem is that I have no way to map between these because:

  • The atlassian_host_mapping table is empty. I understand this is supposed to map between installation ID and client key.
    • I checked and found that installationId is null in the Connect /installed event, which explains why atlassian_host_mapping is empty. But I don’t understand why it’s null in the event—and if that is expected because it’s a Connect /installed event rather than a Forge one, then what is supposed to be populating atlassian_host_mapping?
  • The atlassian_host table’s rows have null for installationId
  • If I do forge install to install my Forge app’s development environment onto my Atlassian instance, it overwrites the Connect app as expected, and I can get the installation ID in the Forge installed event, but I get no client key there (the docs don’t state that it’s included)

I must be missing something, but at the moment I have a bunch of data keyed off of client key, and no way to get an installation ID for that, so I have no way to migrate. How can I get atlassian_host_mapping populated?

Not sure if this could be the issue, but so far I’m only using a Forge development environment, rather than production.

3 Likes

Hey @aprechtl,

Thanks for sharing this, I’m keen to understand what’s happening here as attaining the installationId is an important step in being able to map Forge installations to existing Connect installations.

  • You’ve noted that your /installed event does not contain the installationId, but then suggest that forge install is not returning a clientKey. Wanting to confirm, is the event you’re receiving a Connect lifecycle event within the connectModules section of your manifest?
  • What product are you developing your app for?

Thanks for your message Sean.

It turns out that the problem was that I did not have the Connect lifecycle events in connectModules at all. I didn’t think that was necessary because the Connect lifecycle events are not declared in the modules of our atlassian-connect file—they’re at the top level.

After adding the following to our Forge manifest:

connectModules:
  "jira:lifecycle":
    [
      {
        "key": "connect-lifecycle",
        "installed": "/installed",
        "uninstalled": "/uninstalled"

      }
    ]

I found that whether I go from Connect installation to Forge installation, or simply do a fresh Forge installation, the atlassian_host table then has an installation ID and the atlassian_host_mapping table gets populated appropriately. This was the missing link.

Thanks!

2 Likes