Skip to content

Configure PM Bot backend with MCP integration for intelligent Jira/GitHub ticket management#1

Draft
Copilot wants to merge 8 commits intomainfrom
copilot/configure-pmbot-backend-logic
Draft

Configure PM Bot backend with MCP integration for intelligent Jira/GitHub ticket management#1
Copilot wants to merge 8 commits intomainfrom
copilot/configure-pmbot-backend-logic

Conversation

Copy link

Copilot AI commented Nov 21, 2025

Transforms Slack AI chatbot into @pmbot - an intelligent agent that drafts Jira tickets from natural language using Model Context Protocol (MCP) to fetch GitHub context and enforce documentation standards (DoD/AC in Gherkin format).

Architecture

MCP Integration Layer (/mcp):

  • jira_mcp.py - Ticket CRUD operations, duplicate detection, project metadata
  • github_mcp.py - Repository context, code search, PR/issue queries
  • intent_analyzer.py - NLU for Create/Update/Query intents + entity extraction (priority, project, tech stack, assignee)
  • ticket_drafter.py - Context-aware ticket generation with Gherkin AC and DoD
  • orchestrator.py - Workflow pipeline: analyze → fetch → draft → present

Event Handlers:

  • Enhanced app_mentioned.py and app_messaged.py to detect PM Bot commands and route to orchestrator
  • Falls back to general AI assistant for non-ticket queries

Repository Cleanup:

  • Removed all legacy Slack AI chatbot features (15 files, ~462 lines):
    • App home tab for AI provider selection
    • Slash commands (/ask-pmbot)
    • Channel summarization workflow
    • User state management (state_store/)
    • Interactive actions and OAuth setup
  • Simplified AI provider to auto-detect from environment variables (priority: Anthropic > OpenAI > Vertex)
  • Streamlined manifest to PM Bot essentials only

Usage

# User: "@pmbot create a ticket for user login API, add details, DoD, and AC"

# Bot analyzes intent, extracts entities, fetches GitHub context, checks Jira duplicates
# Returns structured response:

**Summary:** Drafted ticket for User Login API

**Draft Ticket Preview:**
  **Title:** User login API (API)
  **Description:** Implement user login with [GitHub context]
  
  **Acceptance Criteria:**
    - Given the API endpoint is implemented
    - When a valid request is made
    - Then the response returns expected data with status 200
    - And the response follows the API schema
    [...]
  
  **Definition of Done:**
    - Code review completed and approved
    - Unit tests written and passing
    - API documentation updated (Swagger/OpenAPI)
    [...]

**Tool Action (Jira MCP Payload):**
{
  "fields": {
    "project": {"key": "PROJECT"},
    "summary": "User login API (API)",
    "description": "[formatted with AC and DoD]",
    "issuetype": {"name": "Story"},
    "priority": {"name": "Medium"}
  }
}

Configuration

Required environment variables:

  • SLACK_BOT_TOKEN, SLACK_APP_TOKEN - Slack authentication
  • AI provider (one of): ANTHROPIC_API_KEY, OPENAI_API_KEY, or VERTEX_AI_PROJECT_ID

Optional environment variables for full MCP functionality:

  • JIRA_URL, JIRA_API_TOKEN, JIRA_EMAIL - Ticket creation
  • GITHUB_TOKEN, GITHUB_ORG - Context enrichment

Testing

30 tests cover intent detection, entity extraction, ticket drafting, and end-to-end orchestration. Demo script (demo_pmbot.py) showcases API, UI, and database ticket scenarios.

Impact

  • Focused codebase: 24 Python files (down from 39)
  • Reduced complexity: ~500 lines removed
  • Simplified setup: Auto-detect AI provider from environment
  • Single purpose: PM Bot ticket management only

See IMPLEMENTATION_SUMMARY.md for technical details and CLEANUP_SUMMARY.md for cleanup details.

Original prompt

modify this repo to fit this description:

User Story
As a Product Manager using Slack, I want an intelligent bot (@pmbot) that can draft, validate, and execute Jira tickets and GitHub queries using natural language, so that I can maintain high documentation standards (DoD/AC) without manual context switching.

Context & Objective
We need to configure the backend logic for the @pmbot agent. This agent acts as the bridge between Slack inputs and our external tools (Jira/GitHub) using the Model Context Protocol (MCP).

The primary goal is to have the agent interpret intent, fetch technical context to ensure accuracy, and enforce strict documentation standards (Definition of Done, Acceptance Criteria) before any ticket is created.

System Role & Persona
Role: Intelligent backend for @pmbot. Primary Function: Bridge natural language requests, Jira project management, and GitHub code repositories.

Technical Requirements

  1. Tooling & Connectivity
    The agent must be configured with access to the following tools via MCP:

Jira MCP Server: Capability to fetch ticket status, project metadata, and create/update issues (Epics, Stories, Tasks).

GitHub MCP Server: Capability to fetch repository context, active branches, and PR statuses.

GitHub CLI (gh): Support for gh syntax/logic for workflow dispatch or repo interactions.

  1. Operational Workflow
    The backend must implement the following logic flow upon receiving a @pmbot command:

Analyze Context:

Identify Intent: Create | Update | Query.

Extract Entities: Project Name, Priority, Assignee, Tech Stack.

Fetch Data (MCP orchestration):

GitHub: Query for current technical state/code context (if technical).

Jira: Check for duplicates or parent Epics.

Draft Content:

Generate Description (using fetched context).

DoD: Draft a Definition of Done.

AC: Draft Acceptance Criteria (Gherkin: Given/When/Then).

Execute/Confirm:

Present payload to user.

Execute via Jira MCP upon confirmation.

Output Specifications
The agent must return a structured response following this specific schema:

Markdown

  • Summary: [Brief explanation of the action]
  • Draft Ticket Preview:
    • Title: [Proposed Title]
    • Description: [Generated Description based on GitHub context]
    • Acceptance Criteria: [Bulleted list]
    • DoD: [Standard checks + specific requirements]
  • Tool Action: [JSON representation of the MCP call to be made]
    Acceptance Criteria
    [ ] System prompt is configured with the Persona defined above.

[ ] Bot successfully recognizes "Create a ticket" intent.

[ ] Bot queries GitHub MCP to enrich the ticket description before drafting.

[ ] Bot automatically generates valid Gherkin syntax for Acceptance Criteria.

[ ] Bot outputs the raw JSON payload for the intended MCP tool call for debugging/confirmation purposes.

Example Test Case
Input:

"@pmbot create a ticket for the user login API, add details, DoD, and AC."

Expected Behavior: Bot fetches login API context from GitHub, checks Jira for existing login stories, and outputs a drafted story with standard ACs (e.g., "Given user is on login page...").


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 21, 2025
Copilot AI and others added 5 commits November 21, 2025 19:44
Co-authored-by: vivekvinodh <5590649+vivekvinodh@users.noreply.github.com>
Co-authored-by: vivekvinodh <5590649+vivekvinodh@users.noreply.github.com>
Co-authored-by: vivekvinodh <5590649+vivekvinodh@users.noreply.github.com>
Co-authored-by: vivekvinodh <5590649+vivekvinodh@users.noreply.github.com>
Co-authored-by: vivekvinodh <5590649+vivekvinodh@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure backend logic for @pmbot agent Configure PM Bot backend with MCP integration for intelligent Jira/GitHub ticket management Nov 21, 2025
Copilot AI requested a review from vivekvinodh November 21, 2025 20:00
@vivekvinodh
Copy link
Collaborator

@copilot Can we remove everything from the old repo that we no longer need

Co-authored-by: vivekvinodh <5590649+vivekvinodh@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 21, 2025

@copilot Can we remove everything from the old repo that we no longer need

Removed all old Slack AI chatbot features. Deleted 15 files (~462 lines) including app home, slash commands, channel summarization, user state management, and OAuth setup. PM Bot now focuses exclusively on Jira/GitHub ticket management via mentions and DMs. All tests still pass. Commit: 5f41c92

Co-authored-by: vivekvinodh <5590649+vivekvinodh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants