Class JiraTools

java.lang.Object
com.tnsai.tools.productivity.JiraTools

public class JiraTools extends Object
Function-shape Jira tools — issue + JQL operations via the Jira Cloud REST API v3. Replaces the legacy JiraTool (single dispatched tool).
MethodEndpointIdempotent
jiraSearch(java.lang.String, int)GET /rest/api/3/searchtrue
jiraGetIssue(java.lang.String)GET /rest/api/3/issue/{key}true
jiraCreateIssue(java.lang.String, java.lang.String, java.lang.String, java.lang.String)POST /rest/api/3/issuefalse (creates an issue)
jiraTransition(java.lang.String, java.lang.String)POST /rest/api/3/issue/{key}/transitionstrue (state-converging)

Auth is HTTP Basic with email:apiToken (Atlassian Cloud convention). Requires JIRA_BASE_URL (e.g. https://your-domain.atlassian.net), JIRA_EMAIL, and JIRA_API_TOKEN (from id.atlassian.com/manage-profile/security/api-tokens).

Since:
0.5.7 (Phase 2 batch 20 — built-in tool migration to function shape, see #188)
  • Constructor Details

    • JiraTools

      public JiraTools()
      Default constructor — picks JIRA_BASE_URL / JIRA_EMAIL / JIRA_API_TOKEN from env.
    • JiraTools

      public JiraTools(String baseUrl, String email, String apiToken)
      Explicit-credentials constructor.
    • JiraTools

      public JiraTools(String baseUrl, String email, String apiToken, okhttp3.OkHttpClient http, com.fasterxml.jackson.databind.ObjectMapper mapper)
      Full constructor for tests / shared HTTP.
  • Method Details

    • jiraSearch

      @Tool(name="jira_search", description="Search Jira issues using JQL (Jira Query Language). {jql} accepts the full JQL syntax (e.g. \"project = MYPROJ AND status = \'In Progress\'\"). {maxResults} clamps to [1, 100]. Returns the raw JSON with the issues array. Requires JIRA_BASE_URL, JIRA_EMAIL, JIRA_API_TOKEN.", keywords={"jira","search","jql","issues","atlassian"}, idempotent=true) public String jiraSearch(@ToolParam(description="JQL query string") String jql, @ToolParam(description="Max issues to return (1..100); 0 \u2192 default 50",required=false,defaultValue="0") int maxResults) throws IOException
      Throws:
      IOException
    • jiraGetIssue

      @Tool(name="jira_get_issue", description="Fetch a Jira issue by its key (e.g. \"PROJ-123\"). Returns the raw JSON issue object including summary / status / assignee / description / labels.", keywords={"jira","issue","get","ticket"}, idempotent=true) public String jiraGetIssue(@ToolParam(description="Issue key (e.g. \"PROJ-123\")") String issueKey) throws IOException
      Throws:
      IOException
    • jiraCreateIssue

      @Tool(name="jira_create_issue", description="Create a new Jira issue under {projectKey}. {issueType} is one of \"Bug\", \"Task\", \"Story\", \"Epic\", etc. {summary} is the title; {description} is the body (plain text \u2014 Jira wraps it in an Atlassian Document Format paragraph). NOT idempotent \u2014 every call creates a new issue.", keywords={"jira","create","issue","ticket","new"}, idempotent=false) public String jiraCreateIssue(@ToolParam(description="Project key (e.g. \"PROJ\")") String projectKey, @ToolParam(description="Issue type: Bug / Task / Story / Epic / \u2026") String issueType, @ToolParam(description="Issue summary (title)") String summary, @ToolParam(description="Optional plain-text description",required=false,defaultValue="") String description) throws IOException
      Throws:
      IOException
    • jiraTransition

      @Tool(name="jira_transition_issue", description="Move a Jira issue through a workflow transition. {transitionId} is one of the workflow\'s transition ids (use jira_get_issue\'s transitions endpoint via http_request to discover them). State-converging \u2014 transitioning to the same status twice is a no-op at the API level.", keywords={"jira","transition","workflow","status","issue"}, idempotent=true) public String jiraTransition(@ToolParam(description="Issue key (e.g. \"PROJ-123\")") String issueKey, @ToolParam(description="Transition id (string from /transitions endpoint)") String transitionId) throws IOException
      Throws:
      IOException