All,
I'm looking for a solution to update the plugin license, I learn below article which it can set the license for Jira software/servicedesk/core, it's very useful for me.
I also would like the same way to update the plugin license, but I encounter an issue and got "upm.plugin.license.error.invalid.update".
How do I use the correct license name/field in the Request Body for the plugin? Do we have any related KB as this article?
REST API
rest/plugins/1.0/{pluginKey}/license
Method
PUT
Parameter
pluginKey: com.eazybi.jira.plugins.eazybi-jira-key
Request Body
{
"licenseKey": xxx
}
Response
{
"subCode": "upm.plugin.license.error.invalid.update"
}
Thanks,
Shirley
Hello, @Shirley Tsai.
You should use the following request body
{
"rawLicense":"license key here"
}
and Content-Type: application/vnd.atl.plugins+json
Thanks for the feedback. I'm glad of your reply. At the beginning, I'm were finding the way and it's so hard. Now, I already figure out how to use this REST API and implement it to update add-on licenses via Ansible playbook as well.
- name: Update the license of add-on
uri:
url: "https://{{ alias_name }}/jira/rest/plugins/1.0/{{ item.name }}-key/license"
method: PUT
user: account
password: "{{ password}}"
body: '{ "rawLicense":"{{ item.license }}"}'
headers:
Content-Type: "application/vnd.atl.plugins+json"
body_format: json
force_basic_auth: yes
return_content: yes
status_code: 200
with_items:
- { name: '{{ pluginkeys[0] }}', license: '{{ licenses[0] }}' }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,I also want to update plugin license by using REST API. But the result is :
"upm.plugin.license.error.invalid.license"
the method is :put
the URL is :
https://***/jira/rest/plugins/1.0/com.onresolve.jira.groovy.groovyrunner-key/license
Content-Type is : application/vnd.atl.plugins+json
{"rawLicense":"***“}
Diffierent from you my body is text,when i try to change the type to json ,the Content-Type will change .
could you help me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chunyuan,
Do you use Curl command or REST API from Jira Admin? Could you provide your command?
Thanks,
Shirley
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Shirley
thank you for your help
i use Curl command ,now it's success! thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
could you please provide us the curl command you have already used ?
Thanks in advance.
Wajih
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in help of future lost souls, updating plugin license with curl:
curl -H "Content-Type: application/vnd.atl.plugins+json" -H "X-Atlassian-Token: no-check" -u $USERNAME:$PASSWORD -X PUT https://baseurl/rest/plugins/1.0/$PLUGIN_KEY-key/license -d {\"rawLicense\":\"licensewithnospaces\"}
Please note the escape chars on the curl request body, and the -key in the url, after the plugin key, this is not part of the key(!?). No docs for UPM is terrible :/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.