Use marketplace version inside our App

Hello, good day to anyone reading this,
There is something I would like your help with.

I would like to show the application current version on our settings page, and I want to make sure it matches the version that is shown in the marketplace, how as the client I can get the marketplace version of our app that is currently installed, I have searched API v2/3 and couldn’t find anything there, did I miss anything?

Any help is greatly appriciated!

Installed version: License API for cloud apps

Latest version: https://developer.atlassian.com/platform/marketplace/rest/v2/api-group-app-versions/#api-addons-addonkey-versions-latest-get

1 Like

Hello
Thanks for the question and answer. I’m also striving with such challenge right now.
I’ve checked the api but I’m still not sure how to use it. To clarify the problem:
some clients can use version 1.0.0 from Marketplace and some clients can use version 1.0.2 from Marketplace. How to figure out from within the app (whether on front or back end) which marketplace version is currently used/installed?
There would have to be an api that takes customerId as a parameter. Or maybe it’s somwhere in the request context?

The only possibility I can think right now to solve this is to create a separate atlassian-connect.json for each Marketplace version and use different endpoints on backend for each version, but that seems like overdesign and cumbersome.

Any hint how to deal with it?

I should have mention I use connect not Forge - but maybe solution is similar.

@ZbigniewPiecuch it’s in the first link I posted: License API for cloud apps

Paste this into the browser and look for “version” (that’s the installed marketplace app version): https://{instance}.atlassian.net/wiki/rest/atlassian-connect/1/addons/{appKey}

To check in-app, something like…

AP.request(`/rest/atlassian-connect/1/addons/${appKey}`)
    .then((res) => JSON.parse(res.body))
    .then((data) => console.log(data.version))
2 Likes

Hmmm, I’ll try it and will let know. Thanks.

I finally had time to work on this. Thanks @nathanwaters, it works.