'Create a link between two issues.
:param type: the type of link to create
:param inwardIssue: the issue to link from
:param outwardIssue: the issue to link to
:param comment:  a comment to add to the issues with the link. Should be
a dict containing ``body`` and ``visibility`` fields: ``body`` being
the text of the comment and ``visibility`` being a dict containing
two entries: ``type`` and ``value``. ``type`` is ``role`` (or
``group`` if the JIRA server has configured comment visibility for
groups) and ``value`` is the name of the role (or group) to which
viewing of this comment will be restricted.'

@translate_resource_args
def create_issue_link(self, type, inwardIssue, outwardIssue, comment=None):

    if (not hasattr(self, u'_cached_issuetypes')):
        self._cached_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 (lt.outward == type):
                type = lt.name
                break
            elif (lt.inward == type):
                type = lt.name
                (inwardIssue, outwardIssue) = (outwardIssue, inwardIssue)
                break
    data = {u'type': {u'name': type}, u'inwardIssue': {u'key': inwardIssue}, u'outwardIssue': {u'key': outwardIssue}, u'comment': comment}
    url = self._get_url(u'issueLink')
    return self._session.post(url, data=json.dumps(data))
