Skip to content

Commit

Permalink
Make create_issue_link work with issue_link-objects
Browse files Browse the repository at this point in the history
fixes pycontribs#1604

The program was tested solely for our own use cases, which might differ from yours.
___
Jannik Meinecke <jannik.meinecke@mercedes-benz.com> on behalf of MBition GmbH.
https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md

Licensed under [BSD-2-Clause license](https://github.com/pycontribs/jira/blob/main/LICENSE)</sub>
  • Loading branch information
rynkk committed Mar 8, 2023
1 parent 3b5b7b4 commit 5371f29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
for arg in args:
if isinstance(arg, (Issue, Project)):
arg_list.append(arg.key)
elif isinstance(arg, IssueLinkType):
arg_list.append(arg.name)
else:
arg_list.append(arg)
result = func(*arg_list, **kwargs)
Expand Down
7 changes: 7 additions & 0 deletions tests/resources/test_issue_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ def test_create_issue_link(self):
self.test_manager.project_b_issue2,
)

def test_create_issue_link_with_issue_link_obj(self):
self.test_manager.jira_admin.create_issue_link(
self.link_types[0],
self.test_manager.project_b_issue1,
self.test_manager.project_b_issue2,
)

def test_create_issue_link_with_issue_obj(self):
inwardissue = self.test_manager.jira_admin.issue(
self.test_manager.project_b_issue1
Expand Down

0 comments on commit 5371f29

Please sign in to comment.