Commit fd65f80d authored by MD. SHAHIDUL ISLAM's avatar MD. SHAHIDUL ISLAM

feat: Add JQL issue search functionality and document server setup with example prompts.

parent 32dbf8a9
...@@ -149,6 +149,26 @@ def transition_issue(issue_key: str, transition_name: str) -> str: ...@@ -149,6 +149,26 @@ def transition_issue(issue_key: str, transition_name: str) -> str:
except Exception as e: except Exception as e:
return f"Error transitioning issue {issue_key}: {str(e)}" return f"Error transitioning issue {issue_key}: {str(e)}"
@mcp.tool()
def search_issues(jql_query: str) -> str:
"""Searches Jira for issues using a JQL (Jira Query Language) string.
Example: 'project = PCM AND text ~ "Dashboard" ORDER BY created DESC'
"""
jira = _get_jira()
try:
issues = jira.search_issues(jql_query, maxResults=50)
if not issues:
return "No issues found matching the query."
result = [f"Found {len(issues)} issues matching your query:"]
for issue in issues:
assignee = issue.fields.assignee.displayName if issue.fields.assignee else "Unassigned"
priority = issue.fields.priority.name if getattr(issue.fields, 'priority', None) else 'None'
result.append(f"- [{issue.key}] {issue.fields.summary} (Status: {issue.fields.status.name}, Assignee: {assignee}, Priority: {priority})")
return "\n".join(result)
except Exception as e:
return f"Error searching issues: {str(e)}"
if __name__ == "__main__": if __name__ == "__main__":
# Start the FastMCP server # Start the FastMCP server
mcp.run() mcp.run()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment