Skip to content
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.

Commit

Permalink
moveIssue: fix failing on getting project assigneesand add ability to…
Browse files Browse the repository at this point in the history
… sync links
  • Loading branch information
boot85 committed Nov 21, 2018
1 parent 7123ace commit 0668165
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name='youtrack-scripts',
version='0.1.21',
version='0.1.22',
python_requires='>=2.6, <3',
packages=['youtrackutils',
'youtrackutils.bugzilla',
Expand Down
13 changes: 12 additions & 1 deletion youtrackutils/moveIssue.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from youtrack import Issue, YouTrackException
from youtrack.connection import Connection
from youtrack.sync.links import LinkImporter

PREDEFINED_FIELDS = ["summary", "description", "created", "updated",
"updaterName", "resolved", "reporterName",
Expand Down Expand Up @@ -156,7 +157,7 @@ def do_move(source_url, source_login, source_password,
# import issue
print(target.importIssues(
target_project_id,
target.getProjectAssigneeGroups(target_project_id)[0].name,
"",
[target_issue]))

# attachments
Expand Down Expand Up @@ -199,6 +200,16 @@ def do_move(source_url, source_login, source_password,
except YouTrackException as e:
print("Failed to import workitems: " + str(e))

# links
link_importer = LinkImporter(target)
links2import = source_issue.getLinks()
link_importer.collectLinks(links2import)
link_importer.addAvailableIssue(source_issue)
for l in links2import:
link_importer.addAvailableIssue(source.getIssue(l.source))
link_importer.addAvailableIssue(source.getIssue(l.target))
link_importer.importCollectedLinks()


if __name__ == "__main__":
main()

0 comments on commit 0668165

Please sign in to comment.