mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-10 20:35:17 +02:00
feat: add issue URL to Jira issue creation and update responses for direct access
This commit is contained in:
parent
1e9ea983dd
commit
5b6b1e5d72
4 changed files with 45 additions and 8 deletions
|
|
@ -192,6 +192,11 @@ def create_create_jira_issue_tool(
|
|||
raise
|
||||
|
||||
issue_key = api_result.get("key", "")
|
||||
issue_url = (
|
||||
f"{jira_history._base_url}/browse/{issue_key}"
|
||||
if jira_history._base_url and issue_key
|
||||
else ""
|
||||
)
|
||||
|
||||
kb_message_suffix = ""
|
||||
try:
|
||||
|
|
@ -219,6 +224,7 @@ def create_create_jira_issue_tool(
|
|||
return {
|
||||
"status": "success",
|
||||
"issue_key": issue_key,
|
||||
"issue_url": issue_url,
|
||||
"message": f"Jira issue {issue_key} created successfully.{kb_message_suffix}",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,6 +199,12 @@ def create_update_jira_issue_tool(
|
|||
}
|
||||
raise
|
||||
|
||||
issue_url = (
|
||||
f"{jira_history._base_url}/browse/{final_issue_key}"
|
||||
if jira_history._base_url and final_issue_key
|
||||
else ""
|
||||
)
|
||||
|
||||
kb_message_suffix = ""
|
||||
if final_document_id:
|
||||
try:
|
||||
|
|
@ -228,6 +234,7 @@ def create_update_jira_issue_tool(
|
|||
return {
|
||||
"status": "success",
|
||||
"issue_key": final_issue_key,
|
||||
"issue_url": issue_url,
|
||||
"message": f"Jira issue {final_issue_key} updated successfully.{kb_message_suffix}",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ interface InterruptResult {
|
|||
interface SuccessResult {
|
||||
status: "success";
|
||||
issue_key: string;
|
||||
issue_url?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
|
|
@ -515,10 +516,21 @@ function SuccessCard({ result }: { result: SuccessResult }) {
|
|||
</div>
|
||||
<div className="mx-5 h-px bg-border/50" />
|
||||
<div className="px-5 py-4 space-y-2 text-xs">
|
||||
<div>
|
||||
<span className="font-medium text-muted-foreground">Issue Key: </span>
|
||||
<span>{result.issue_key}</span>
|
||||
</div>
|
||||
{result.issue_url ? (
|
||||
<a
|
||||
href={result.issue_url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-primary hover:underline"
|
||||
>
|
||||
Open in Jira
|
||||
</a>
|
||||
) : (
|
||||
<div>
|
||||
<span className="font-medium text-muted-foreground">Issue Key: </span>
|
||||
<span>{result.issue_key}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ interface InterruptResult {
|
|||
interface SuccessResult {
|
||||
status: "success";
|
||||
issue_key: string;
|
||||
issue_url?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
|
|
@ -532,10 +533,21 @@ function SuccessCard({ result }: { result: SuccessResult }) {
|
|||
</div>
|
||||
<div className="mx-5 h-px bg-border/50" />
|
||||
<div className="px-5 py-4 space-y-2 text-xs">
|
||||
<div>
|
||||
<span className="font-medium text-muted-foreground">Issue Key: </span>
|
||||
<span>{result.issue_key}</span>
|
||||
</div>
|
||||
{result.issue_url ? (
|
||||
<a
|
||||
href={result.issue_url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-primary hover:underline"
|
||||
>
|
||||
Open in Jira
|
||||
</a>
|
||||
) : (
|
||||
<div>
|
||||
<span className="font-medium text-muted-foreground">Issue Key: </span>
|
||||
<span>{result.issue_key}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue