Licensing of Cloud Plugin not working

I have added this in atlassian-connect.json file but still while testing with jira license api.

“license”: {
“active”: true,
“type”: “COMMERCIAL”,
“evaluation”: false,
“supportEntitlementNumber”: “SEN-###”
}

https://acisplugin.atlassian.net/rest/atlassian-connect/1/addons/itsmforcloud

Not getting license details in response so how can i add licensing.
i have gone through this link
https://developer.atlassian.com/platform/marketplace/cloud-app-licensing/?utm_source=%2Fstatic%2Fconnect%2Fdocs%2Flatest%2Fconcepts%2Flicensing.html&utm_medium=301
Here it is saying add enableLicensing:true i tried this and then also not working any suggestions how this will work.

Hi Charkesh,

I think it’s better to use https://developer.atlassian.com/cloud/jira/software/jsapi/context/#getContext, see response.license for license.status, e.g. active, however in development it’s also empty, but on production both end-point you’ve used and context using getContext api do have license, as documented.

Note, if you you look at Jira Settings - Apps - Manage apps and find your app, you will see it is Unlicensed in development, and checking the page you have references, at the very end, you can see there is no easy way to test licensing, you may need to create private listing at Marketplcase first and install your app from Marketplace using private token for this.

Hope it helps.

Thank you.

You’d need to hit the rest api as the app user (not as a regular user).

Thanks @azhdanov for your suggestion I will try and that.

Hi @azhdanov i have Listed app in marketPlace as Private and in app descriptor i have given enableLicensing :true But still it is showing unlicensed why? and i am creating tokens but those tokens are not linked with cloud id any suggesstions for these problems??

There should be Links button, then you should use one of the links to install app into your instance, then it has to be licensed.

thanks for response
But form me this links is not showing why any suggesstion what i missed?

If you only have one version that has licensing enabled on it - you won’t get the drop down (I believe). Click on the “Download” button next to the token and copy the url. Then head over to the add-on manager in the instance that you want to add the license - and paste the url in as the “Manual upload” piece.

I would suggest removing the tokens in your screenshot that you don’t want people wandering around CDAC to use :slight_smile:

Hi @danielwester
Thanks for response now that token is linked with app but still app is showing unlicensed why?
License details: Unlicensed
And should i need to add lic=active in each rest call??

Hi @danielwester and @azhdanov
Thanks for help now license is enabled in my app the only thing left is validating each rest call for checking whether a license is active or not so for that
I need to use this rest call and passing value of active to request
https://acisplugin.atlassian.net/rest/atlassian-connect/1/addons/itsmforcloud
or if not correct then what is another way to validate each call??
Thanks for suggestions

It depends on your app. If your app has a single front end - then just check for the lic=active in the query string (and validate the qsh). Then if you have any rest end points on your side - then just you can just a token a long that validates the login of the user AND that they’ve passed the initial check (ACE does this for you with the token parameter).

If you don’t have a front end - then I would at least cache the rest call for a bit so that you don’t get hit each time. Doing the validation for example on a issue web hook might not be advisable…

/Daniel