Skip to content

bro-n-bro-2/python

 
 

Repository files navigation

#insert user:pass, change example.com to your URL, remove YOUR_WEBHOOK_URL with your webhook https://api.slack.com/tutorials/slack-apps-hello-world
curl -u "user:pass" -X GET https://example.com/bitbucket/rest/api/1.0/users?permission=LICENSED_USER\&limit=1000 2>/dev/null | head -n 1 | cut -d',' -f1|awk -F":" '{print $2}' | while read id; do curl -X POST -H "Content-type: text/html" --data '{"text": "Count of Bitbucket licenses: '$id'"}' YOUR_WEBHOOK_URL ;done
curl -u "user:pass" -X GET https://example.com/jira/rest/api/2/applicationrole 2>/dev/null |awk -F":" '{print $10}' |cut -d ',' -f1  | while read id; do curl -X POST -H "Content-type: text/html" --data '{"text": "Count of Jira-Service Desk licenses: '$id'"}' YOUR_WEBHOOK_URL ;done
curl -u "user:pass" -X GET https://example.com/jira/rest/api/2/applicationrole 2>/dev/null |awk -F":" '{print $22}' |cut -d ',' -f1  | while read id; do curl -X POST -H "Content-type: text/html" --data '{"text": "Count of Jira Software licenses: '$id'"}' YOUR_WEBHOOK_URL ;done
curl -u "user:pass" -X GET https://example.com/confluence/dosearchsite.action?cql=type+%3D+%22user%22 |grep 'data-totalsize=' |cut -f6 -d '"' | while read id; do curl -X POST -H "Content-type: text/html" --data '{"text": "Count of Confluence licenses: '$id'"}' YOUR_WEBHOOK_URL ; done

About

Python-atlassian-slack

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.4%
  • Shell 4.6%