@@ -36,19 +36,38 @@ def get_jira_details(
36
36
issue_key : Annotated [str , Field (description = "Jira issue key (e.g. RHEL-12345)" )],
37
37
) -> dict [str , Any ] | str :
38
38
"""
39
- Gets details about the specified Jira issue, including all comments.
39
+ Gets details about the specified Jira issue, including all comments and remote links .
40
40
Returns a dictionary with issue details and comments or an error message on failure.
41
41
"""
42
+ headers = _get_jira_headers (os .getenv ("JIRA_TOKEN" ))
43
+
44
+ # Get main issue data
42
45
try :
43
46
response = requests .get (
44
47
urljoin (os .getenv ("JIRA_URL" ), f"rest/api/2/issue/{ issue_key } " ),
45
48
params = {"expand" : "comments" },
46
- headers = _get_jira_headers ( os . getenv ( "JIRA_TOKEN" )) ,
49
+ headers = headers ,
47
50
)
48
51
response .raise_for_status ()
52
+ issue_data = response .json ()
49
53
except requests .RequestException as e :
50
54
return f"Failed to get details about the specified issue: { e } "
51
- return response .json ()
55
+
56
+ # get remote links - these often contain links to PRs or mailing lists
57
+ try :
58
+ remote_links_response = requests .get (
59
+ urljoin (os .getenv ("JIRA_URL" ), f"rest/api/2/issue/{ issue_key } /remotelink" ),
60
+ headers = headers ,
61
+ )
62
+ remote_links_response .raise_for_status ()
63
+ remote_links = remote_links_response .json ()
64
+ issue_data ["remote_links" ] = remote_links
65
+ except requests .RequestException as e :
66
+ # If remote links fail, continue without them
67
+ issue_data ["remote_links" ] = []
68
+
69
+ return issue_data
70
+
52
71
53
72
54
73
def set_jira_fields (
0 commit comments