Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in automation of updating existing plugins of JIRA

Sunil Kumar November 5, 2018

Hi All,

We have some custom plugins developed by our development team for JIRA and our dev team is asking us to automate the new plugin installation as well as updating existing plugins.

Support team has already suggested below documentation but it was not clear to me and moreover i am not that expert in script. 

I would appreciate if someone please help me in automating the plugin update and well as plugin installation.

https://developer.atlassian.com/platform/marketplace/registering-apps/?utm_source=%2Fmarket%2Ffaqs%2Finstalling-an-add-on&utm_medium=302

 

Note: We have on-premise standalone JIRA server

 

Thanks,

Sunil Palugula

3 answers

0 votes
Sunil Kumar November 19, 2018

@Thomas Deiler Thanks for the quick turn around.

 

I have tried below but getting error.

 

url="http://admin:admin@localhost:2990/jira/rest/plugins/1.0/"
token=$(curl -sI "$url?os_authType=basic" | grep upm-token | cut -d: -f2- | tr -d '[[:space:]]')
curl -XPOST "$url?token=$token" -F plugin=@path-to-plugin.jar

Error: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>401</status-code><message>Client must be authenticated to access this resource.</message></status>

 

I am not not able to understand how to pass my  credentials and my JIRA URL to verify below

url="https://&lt;username&gt;:&lt;password&gt;@&lt;instancename&gt;.atlassian.net/rest/plugins/1.0/"; token=$(curl -sI -H "Accept: application/vnd.atl.plugins.installed+json" "$url?os_authType=basic" | grep upm-token | cut -d: -f2- | tr -d '[[:space:]]'); curl -X POST -v -d '{ "pluginUri" : "&lt;addon-base-url&gt;/atlassian-connect.json"}' -H "Content-type: application/vnd.atl.plugins.remote.install+json" "$url?token=$token"

 

 Thanks,

Sunil Palugula

0 votes
Sunil Kumar November 11, 2018

Hi Thomas, Thanks for the update - As mentioned earlier i am not expert in scripting, moreover before moving ahead with automating plugin installation using script i am trying from GUI and getting struck with the second part mentioned in the below documentation.

As per the second part of the documentation says to POST the request to install the plugin. But to post the request we need to provide the data in JSON format below now i confused what will be plugin-xml-url for my custom plugin developed by our plugin development team

{
  "pluginUri": "${plugin-xml-url}",
  "pluginName": "the app name"
}

https://developer.atlassian.com/platform/marketplace/registering-apps/?utm_source=%2Fmarket%2Ffaqs%2Finstalling-an-add-on&utm_medium=302&_ga=2.161188093.1923767611.1541983834-220613382.1538527412

 

Thanks,

Sunil Palugula

Sunil Kumar November 19, 2018

Hi Thomas,

 

Any update on the above comment?

 

Thanks,

Sunil Palugula

Thomas Deiler
Community Champion
November 19, 2018

Had a look to my second post?

0 votes
Thomas Deiler
Community Champion
November 7, 2018

Dear @Sunil Kumar,

everything you need to know is written in this article you listed. You need some coding/scripting skills to finish you task. This can be done with PHP, python or perl as well as with higher programming languages like Java.

Following this link will give you an idea, how to do with python.

So long

Thomas

Thomas Deiler
Community Champion
November 12, 2018

See this post.

Thomas Deiler
Community Champion
December 10, 2018

Dear @Sunil Kumar,

sorry for the delay.

When using the rest api, you have to pass your credentials with every request. The method is called "Basic Authentication".

See this link.

Of cause, you can also check out OAuth.

So long

   Thomas

Suggest an answer

Log in or Sign up to answer