Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix in method create_issue_link #782

Merged
merged 3 commits into from
May 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,11 +1974,10 @@ def create_issue_link(self, type, inwardIssue, outwardIssue, comment=None):
:rtype: Response
"""
# let's see if we have the right issue link 'type' and fix it if needed
if not hasattr(self, '_cached_issuetypes'):
self._cached_issue_link_types = self.issue_link_types()
issue_link_types = self.issue_link_types()

if type not in self._cached_issue_link_types:
for lt in self._cached_issue_link_types:
if type not in issue_link_types:
for lt in issue_link_types:
if lt.outward == type:
# we are smart to figure it out what he meant
type = lt.name
Expand Down Expand Up @@ -2018,15 +2017,18 @@ def issue_link(self, id):

# Issue link types

def issue_link_types(self):
def issue_link_types(self, force=False):
"""Get a list of issue link type Resources from the server.

:rtype: List[IssueLinkType]
"""
r_json = self._get_json('issueLinkType')
link_types = [IssueLinkType(self._options, self._session, raw_link_json) for raw_link_json in
r_json['issueLinkTypes']]
return link_types
if not hasattr(self, 'self._cached_issue_link_types') or force:
r_json = self._get_json('issueLinkType')
self._cached_issue_link_types = [
IssueLinkType(self._options, self._session, raw_link_json)
for raw_link_json in r_json['issueLinkTypes']
]
return self._cached_issue_link_types

def issue_link_type(self, id):
"""Get an issue link type Resource from the server.
Expand Down