@@ -36,19 +36,38 @@ def get_jira_details(
3636 issue_key : Annotated [str , Field (description = "Jira issue key (e.g. RHEL-12345)" )],
3737) -> dict [str , Any ] | str :
3838 """
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 .
4040 Returns a dictionary with issue details and comments or an error message on failure.
4141 """
42+ headers = _get_jira_headers (os .getenv ("JIRA_TOKEN" ))
43+
44+ # Get main issue data
4245 try :
4346 response = requests .get (
4447 urljoin (os .getenv ("JIRA_URL" ), f"rest/api/2/issue/{ issue_key } " ),
4548 params = {"expand" : "comments" },
46- headers = _get_jira_headers ( os . getenv ( "JIRA_TOKEN" )) ,
49+ headers = headers ,
4750 )
4851 response .raise_for_status ()
52+ issue_data = response .json ()
4953 except requests .RequestException as e :
5054 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+
5271
5372
5473def set_jira_fields (
0 commit comments