Skip to content

Commit fd1edb3

Browse files
committed
add support for multiple blocked and depends on tickets
1 parent e011e06 commit fd1edb3

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

bugzilla2gitlab/models.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,16 @@ def create_description(self, fields):
173173
"Architecture", fields.get("rep_platform")
174174
)
175175

176+
deplist = ""
177+
blocklist = ""
176178
if fields.get("dependson") is not None:
177-
self.description += markdown_table_row(
178-
"Depends On", "[{}]({})".format(fields.get("dependson"), link)
179-
)
179+
for depends in fields.get("dependson"):
180+
deplist += "[{}]({}) ".format(depends, link)
181+
self.description += markdown_table_row("Depends On", deplist)
180182
if fields.get("blocked") is not None:
181-
self.description += markdown_table_row(
182-
"Blocked by", "[{}]({})".format(fields.get("blocked"), link)
183-
)
183+
for blocked in fields.get("blocked"):
184+
blocklist += "[{}]({}) ".format(blocked, link)
185+
self.description += markdown_table_row("Blocked by", blocklist)
184186

185187
# add first comment to the issue description
186188
attachments = []

bugzilla2gitlab/utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,7 @@ def get_bugzilla_bug(bugzilla_url, bug_id):
8181
bug_xml = _fetch_bug_content(bugzilla_url, bug_id)
8282
tree = ElementTree.fromstring(bug_xml)
8383

84-
bug_fields = {
85-
"long_desc": [],
86-
"attachment": [],
87-
"cc": [],
88-
}
84+
bug_fields = {"long_desc": [], "attachment": [], "cc": [], "dependson": []}
8985
for bug in tree:
9086
for field in bug:
9187
if field.tag in ("long_desc", "attachment"):
@@ -95,6 +91,8 @@ def get_bugzilla_bug(bugzilla_url, bug_id):
9591
bug_fields[field.tag].append(new)
9692
elif field.tag == "cc":
9793
bug_fields[field.tag].append(field.text)
94+
elif field.tag == "dependson":
95+
bug_fields[field.tag].append(field.text)
9896
else:
9997
bug_fields[field.tag] = field.text
10098

0 commit comments

Comments
 (0)