|
8 | 8 |
|
9 | 9 | from youtrack import Issue, YouTrackException |
10 | 10 | from youtrack.connection import Connection |
| 11 | +from youtrack.sync.links import LinkImporter |
11 | 12 |
|
12 | 13 | PREDEFINED_FIELDS = ["summary", "description", "created", "updated", |
13 | 14 | "updaterName", "resolved", "reporterName", |
@@ -156,7 +157,7 @@ def do_move(source_url, source_login, source_password, |
156 | 157 | # import issue |
157 | 158 | print(target.importIssues( |
158 | 159 | target_project_id, |
159 | | - target.getProjectAssigneeGroups(target_project_id)[0].name, |
| 160 | + "", |
160 | 161 | [target_issue])) |
161 | 162 |
|
162 | 163 | # attachments |
@@ -199,6 +200,16 @@ def do_move(source_url, source_login, source_password, |
199 | 200 | except YouTrackException as e: |
200 | 201 | print("Failed to import workitems: " + str(e)) |
201 | 202 |
|
| 203 | + # links |
| 204 | + link_importer = LinkImporter(target) |
| 205 | + links2import = source_issue.getLinks() |
| 206 | + link_importer.collectLinks(links2import) |
| 207 | + link_importer.addAvailableIssue(source_issue) |
| 208 | + for l in links2import: |
| 209 | + link_importer.addAvailableIssue(source.getIssue(l.source)) |
| 210 | + link_importer.addAvailableIssue(source.getIssue(l.target)) |
| 211 | + link_importer.importCollectedLinks() |
| 212 | + |
202 | 213 |
|
203 | 214 | if __name__ == "__main__": |
204 | 215 | main() |
0 commit comments