How to check and see if app install is still valid?

When building a JIRA Cloud app and handling the install/uninstall web hooks…there’s still a chance an uninstall payload could get lost in the ether. (Blame the :turtle:.)

Is there a reliable way to check to see if a JIRA Cloud instance still has our app installed? Obviously we could try to check server info and see if the credentials are still valid (i.e. we can authenticate). Or similar. Just wondering if there’s a more direct way.

Thanks!

Yes - the uninstall call can get lost - so you’re not wrong in thinking of that happening. There are also the cases where Atlassian kills the instance (you don’t get a uninstall call then either).

Best thing is to check once a day against the license api ( License API for cloud apps has it documented - remove /wiki for Jira ). Then after X days of sequential non access then you can probably guarantee that the instance is gone and it’s not just a networking issue.

2 Likes

Ah, really nice tip on Atlassian removing the instance. Didn’t think about that.

Thanks, that’s perfect. :+1:

Aside to @daniel : Thanks for the suggestion - I’ve put in a revision for that documentation page to make it clear that Jira and Confluence have separate URIs for the license resource.

I’ve a follow up question.

Is there a way to detect if the app is still installed for all installations? I can use this API for the Jira/Confluence instance I own. But I can’t call this API ‘as the app’ or the ‘app vendor’ for all the existing installations?

Background. We want to check and cleanup our database for connect apps. To ensure we removed all data for uninstalled instances.

1 Like

Ok, we use this method now to detect if the app was uninstalled, but still has database entries.

  1. Use the ‘sharedSecret’ from the installation table.
  2. Create a new application JWT token with that secret.
  3. Call a some basic REST API in Confluence.
    a) If the app was uninstalled, the endpoint returns a 404.
    b) Otherwise it returns a 200 (or some other error).

We clean out the entries which return a 404.