Thursday, March 8, 2018

Get the list of user installed plugin in JIRA

Goal:

To get the list of user installed plugin in a JIRA instance

Tools used:

Python with 'requests' module installed

Script:

import json
import requests
headers = {"Authorization": "Basic <CREDS base64 encoded>", "Content-Type": "application/json"}
url = "<base url>/rest/plugins/1.0/"
resp = requests.get(url, headers=headers)
ResponseJson = resp.content.decode("utf-8")
parsed_ResponseJson = json.loads(ResponseJson)
pluginsData = parsed_ResponseJson['plugins']

for plugin in pluginsData:
if plugin['userInstalled']:
print(plugin['name'], ",", plugin['version'], ",", plugin['vendor']['name'])