Skip to content

[Jira] Adapt issue remote links creation/update #1211

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

Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -1509,6 +1509,7 @@ def create_or_update_issue_remote_links(
relationship=None,
icon_url=None,
icon_title=None,
status_resolved=False
):
"""
Add Remote Link to Issue, update url if global_id is passed
Expand All @@ -1519,10 +1520,11 @@ def create_or_update_issue_remote_links(
:param relationship: str, OPTIONAL: Default by built-in method: 'Web Link'
:param icon_url: str, OPTIONAL: Link to a 16x16 icon representing the type of the object in the remote system
:param icon_title: str, OPTIONAL: Text for the tooltip of the main icon describing the type of the object in the remote system
:param status_resolved: bool, OPTIONAL: if set to True, Jira renders the link strikethrough
"""
base_url = self.resource_url("issue")
url = "{base_url}/{issue_key}/remotelink".format(base_url=base_url, issue_key=issue_key)
data = {"object": {"url": link_url, "title": title}}
data = {"object": {"url": link_url, "title": title, "status": {"resolved": status_resolved}}}
if global_id:
data["globalId"] = global_id
if relationship:
Expand All @@ -1533,7 +1535,7 @@ def create_or_update_issue_remote_links(
icon_data["url16x16"] = icon_url
if icon_title:
icon_data["title"] = icon_title
data["icon"] = icon_data
data["object"]["icon"] = icon_data
return self.post(url, data=data)

def get_issue_remote_link_by_id(self, issue_key, link_id):
Expand Down
2 changes: 1 addition & 1 deletion docs/jira.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Manage issues
jira.remove_issue_link(link_id)

# Create or Update Issue Remote Links
jira.create_or_update_issue_remote_links(issue_key, link_url, title, global_id=None, relationship=None, icon_url=None, icon_title=None)
jira.create_or_update_issue_remote_links(issue_key, link_url, title, global_id=None, relationship=None, icon_url=None, icon_title=None, status_resolved=False)

# Get Issue Remote Link by link ID
jira.get_issue_remote_link_by_id(issue_key, link_id)
Expand Down