Skip to content

Instantly share code, notes, and snippets.

@dodok1
Last active April 6, 2018 13:35
Show Gist options
  • Save dodok1/b56df9b2f4526bd18819dce1035c04aa to your computer and use it in GitHub Desktop.
Save dodok1/b56df9b2f4526bd18819dce1035c04aa to your computer and use it in GitHub Desktop.
List installed addongs
#!/bin/bash
####
# extractUserAddons.sh <baseurl> <userid> <passwd>
#
BASEURL=$1
USERID=$2
PASSWD=$3
if [ -z "$BASEURL" -o -z "$USERID" ]; then
echo "provide baseurl userid [password]"
exit 1
fi
if [ -z "$PASSWD" ]; then
read -s -p "Password:" PASSWD
echo
fi
#
# use curl to retrieve all the addons from the UPM on the JIRA
# use jq to select only the addons which have properties .userInstalled and
#
echo '|| Key || Version || Name || License || Vendor ||'
curl -s --user $USERID:$PASSWD $BASEURL/rest/plugins/1.0/ | jq -r '.plugins | map(select(.userInstalled and (.applicationPluginType // "PRIMARY") == "PRIMARY")) | .[] | "| \(.key) | \(.version) | \(.name) | \(.usesLicensing) | \(.vendor.name) |"' | sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment