Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Set license issue with rest/plugins/1.0/{pluginKey}/license

Edited

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.

https://confluence.atlassian.com/jirakb/how-to-retrieve-application-license-details-or-set-the-license-via-private-rest-api-in-jira-7+-934728265.html?_ga=2.57725353.225961834.1588033245-1404324419.1573778045

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

1 answer

1 accepted

0 votes
Answer accepted

Hello, @Shirley Tsai

You should use the following request body

{
"rawLicense":"license key here"
}

 and Content-Type: application/vnd.atl.plugins+json

Hi @Volodymyr Havryliuk

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] }}' }
Like Volodymyr Havryliuk likes this

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?

Hi Chunyuan,

Do you use Curl command or REST API from Jira Admin? Could you provide your command?

Thanks,
Shirley

hi Shirley

thank you for your help

i use Curl command ,now it's success! thank you 

Hi @chunyuan_qian 

 

could you please provide us the curl command you have already used ?

 

Thanks in advance.

 

Wajih

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you