I have several host licenses to update and i want to automate it. Getting license works without issues. Setting license does not work, returns response code 415 without any text.
Using python3.
Headers:
headers = {"Content-Type": "application/json", "Accept": "*", "Authorization": "Basic "+encoded}
and the test get request:
response = requests.get(jira_base+"/rest/plugins/applications/1.0/installed/jira-software/license", headers=headers)
this works.
Setting the license does not. Using same headers and this is my request.
data = {
"licenseKey": "<MyLicenseKey>"
}
headers = {"Content-Type": "application/json", "Authorization": "Basic "+encoded}
response = requests.post(jira_base+"/rest/plugins/applications/1.0/installed/jira-software/license", headers=headers, data=json.dumps(data))
following this page: https://confluence.atlassian.com/jirakb/how-to-retrieve-application-license-details-or-set-the-license-via-private-rest-api-in-jira-7+-934728265.html
and i get <Response [415]> without any other info.
I use the next method
def update_plugin_license(self, plugin_key, raw_license):
"""
Update license for plugin
:param plugin_key:
:param raw_license:
:return:
"""
app_headers = {
"X-Atlassian-Token": "no-check",
"Content-Type": "application/vnd.atl.plugins+json",
}
url = "rest/plugins/1.0/{plugin_key}/license".format(plugin_key=plugin_key)
data = {"rawLicense": raw_license}
return self.put(url, data=data, headers=app_headers)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the Jira License, I did not test yet
https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/jira.py#L2825
once it's ready I will share info
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am still getting 405:
HTTPError: 405 Client Error: for url: http://jira:8080/plug
ins/1.0/org.everit.jira.timetracker.plugin/license
i am using this:
response = jira.update_plugin_license(plugin['key'], raw_license)
is there any specific way you have to format the license itself? Does this work with later versions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.