Jira

JiraTools let an agent search, create, and comment on Jira issues, and log worklogs against them.

JiraTools enable an Agent to perform Jira tasks.

Prerequisites

The following example requires the jira and openai libraries and auth credentials.

uv pip install -U agno jira openai
export JIRA_SERVER_URL="YOUR_JIRA_SERVER_URL"
export JIRA_USERNAME="YOUR_USERNAME"
export JIRA_TOKEN="YOUR_API_TOKEN"

Example

The following agent will use Jira API to search for issues in a project.

cookbook/91_tools/jira_tools.py
from agno.agent import Agent
from agno.tools.jira import JiraTools

agent = Agent(tools=[JiraTools()])
agent.print_response("Find all issues in project PROJ", markdown=True)

Toolkit Params

ParameterTypeDefaultDescription
server_urlstrNoneThe URL of the JIRA server, retrieved from the environment variable JIRA_SERVER_URL. Raises an error if not set.
usernamestrNoneThe JIRA username for authentication, retrieved from the environment variable JIRA_USERNAME. Default is None if not set.
passwordstrNoneThe JIRA password for authentication, retrieved from the environment variable JIRA_PASSWORD. Default is None if not set.
tokenstrNoneThe JIRA API token for authentication, retrieved from the environment variable JIRA_TOKEN. Default is None if not set.
enable_get_issueboolTrueEnable the get_issue functionality.
enable_create_issueboolTrueEnable the create_issue functionality.
enable_search_issuesboolTrueEnable the search_issues functionality.
enable_add_commentboolTrueEnable the add_comment functionality.
enable_add_worklogboolTrueEnable the add_worklog functionality.
allboolFalseEnable all functionality.

Toolkit Functions

FunctionDescription
get_issueRetrieves issue details from JIRA. Parameters include:
- issue_key: the key of the issue to retrieve
Returns a JSON string containing issue details or an error message.
create_issueCreates a new issue in JIRA. Parameters include:
- project_key: the project in which to create the issue
- summary: the issue summary
- description: the issue description
- issuetype: the type of issue (default is "Task")
Returns a JSON string with the new issue's key and URL or an error message.
search_issuesSearches for issues using a JQL query in JIRA. Parameters include:
- jql_str: the JQL query string
- max_results: the maximum number of results to return (default is 50)
Returns a JSON string containing a list of dictionaries with issue details or an error message.
add_commentAdds a comment to an issue in JIRA. Parameters include:
- issue_key: the key of the issue
- comment: the comment text
Returns a JSON string indicating success or an error message.
add_worklogAdds a worklog entry to log time spent on an issue. Parameters include:
- issue_key: the key of the issue
- time_spent: the amount of time in Jira's format, e.g., '2h', '30m', '1d 4h'
- comment: an optional comment describing the work done
Returns a JSON string indicating success or an error message.

Developer Resources