Skip to content

Commit d4be9bd

Browse files
authored
[Jira] Adapt issue remote links creation/update (#1211)
* [Jira] fix: correctly nest icon dict in remote links * [Jira] feat: introduce status_resolved to issue remote link creation --------- Co-authored-by: André Frimberger <andre@intellisoft.de>
1 parent a779dcc commit d4be9bd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

atlassian/jira.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,7 @@ def create_or_update_issue_remote_links(
15081508
relationship=None,
15091509
icon_url=None,
15101510
icon_title=None,
1511+
status_resolved=False
15111512
):
15121513
"""
15131514
Add Remote Link to Issue, update url if global_id is passed
@@ -1518,10 +1519,11 @@ def create_or_update_issue_remote_links(
15181519
:param relationship: str, OPTIONAL: Default by built-in method: 'Web Link'
15191520
:param icon_url: str, OPTIONAL: Link to a 16x16 icon representing the type of the object in the remote system
15201521
:param icon_title: str, OPTIONAL: Text for the tooltip of the main icon describing the type of the object in the remote system
1522+
:param status_resolved: bool, OPTIONAL: if set to True, Jira renders the link strikethrough
15211523
"""
15221524
base_url = self.resource_url("issue")
15231525
url = "{base_url}/{issue_key}/remotelink".format(base_url=base_url, issue_key=issue_key)
1524-
data = {"object": {"url": link_url, "title": title}}
1526+
data = {"object": {"url": link_url, "title": title, "status": {"resolved": status_resolved}}}
15251527
if global_id:
15261528
data["globalId"] = global_id
15271529
if relationship:
@@ -1532,7 +1534,7 @@ def create_or_update_issue_remote_links(
15321534
icon_data["url16x16"] = icon_url
15331535
if icon_title:
15341536
icon_data["title"] = icon_title
1535-
data["icon"] = icon_data
1537+
data["object"]["icon"] = icon_data
15361538
return self.post(url, data=data)
15371539

15381540
def get_issue_remote_link_by_id(self, issue_key, link_id):

docs/jira.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Manage issues
241241
jira.remove_issue_link(link_id)
242242
243243
# Create or Update Issue Remote Links
244-
jira.create_or_update_issue_remote_links(issue_key, link_url, title, global_id=None, relationship=None, icon_url=None, icon_title=None)
244+
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)
245245
246246
# Get Issue Remote Link by link ID
247247
jira.get_issue_remote_link_by_id(issue_key, link_id)

0 commit comments

Comments
 (0)