Last active
May 25, 2020 08:24
-
-
Save dev-gwang/b64fd4c80833d477d18590e0cfa73e8c to your computer and use it in GitHub Desktop.
bamboo plan result xml parsing / Bamboo plan 결과 파싱 스크립트
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import xml.etree.ElementTree as elemTree | |
import sys | |
from requests.auth import HTTPBasicAuth | |
import json | |
import sys | |
list_issues = [] | |
IP = "<BAMBOO SERVER IP>" | |
ISSUE_KEY = "<JIRA ISSUE_KEY>" | |
USERID = "<BAMBOO USERID>" | |
PASSWD = "<BAMBOO PASSWD>" | |
req = requests.get("http://{}/rest/api/latest/result/{}?expand=jiraIssues".format(IP, ISSUE_KEY), auth=(USERID, PASSWD)) | |
root = elemTree.fromstring(req.text) | |
tree = elemTree.ElementTree(elemTree.fromstring(req.text)) | |
res = tree.find('jiraIssues') | |
if res: | |
tt = list(res.iter('issue')) | |
for t in tt: | |
key = t.get('key') | |
list_issues.append(key) | |
print(str(list_issues).replace("\n", "").replace("'", "\\\"")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment