> For the complete documentation index, see [llms.txt](https://docs.projectbit.ca/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.projectbit.ca/documentation/tools/jira.md).

# Jira

**JiraTools** enable an Agent to perform Jira tasks.

### [​](https://docs.phidata.com/tools/jira#prerequisites)Prerequisites <a href="#prerequisites" id="prerequisites"></a>

The following example requires the `jira` library and auth credentials.

```shell
pip install -U jira
```

```shell
export JIRA_SERVER_URL="YOUR_JIRA_SERVER_URL"
export JIRA_USERNAME="YOUR_USERNAME"
export JIRA_API_TOKEN="YOUR_API_TOKEN"
```

### [​](https://docs.phidata.com/tools/jira#example)Example <a href="#example" id="example"></a>

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

cookbook/tools/jira\_tools.py

```python
from bitca.agent import Agent
from bitca.tools.jira_tools import JiraTools

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

### [​](https://docs.phidata.com/tools/jira#toolkit-params)Toolkit Params <a href="#toolkit-params" id="toolkit-params"></a>

| Parameter    | Type  | Default | Description                                                                                                                   |
| ------------ | ----- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `server_url` | `str` | `""`    | The URL of the JIRA server, retrieved from the environment variable `JIRA_SERVER_URL`. Default is an empty string if not set. |
| `username`   | `str` | `None`  | The JIRA username for authentication, retrieved from the environment variable `JIRA_USERNAME`. Default is None if not set.    |
| `password`   | `str` | `None`  | The JIRA password for authentication, retrieved from the environment variable `JIRA_PASSWORD`. Default is None if not set.    |
| `token`      | `str` | `None`  | The JIRA API token for authentication, retrieved from the environment variable `JIRA_TOKEN`. Default is None if not set.      |

### [​](https://docs.phidata.com/tools/jira#toolkit-functions)Toolkit Functions <a href="#toolkit-functions" id="toolkit-functions"></a>

| Function        | Description                                                                                                                                                                                                                                                                                                                                                                          |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `get_issue`     | <p>Retrieves issue details from JIRA. Parameters include:<br>- <code>issue\_key</code>: the key of the issue to retrieve<br>Returns a JSON string containing issue details or an error message.</p>                                                                                                                                                                                  |
| `create_issue`  | <p>Creates a new issue in JIRA. Parameters include:<br>- <code>project\_key</code>: the project in which to create the issue<br>- <code>summary</code>: the issue summary<br>- <code>description</code>: the issue description<br>- <code>issuetype</code>: the type of issue (default is “Task”)<br>Returns a JSON string with the new issue’s key and URL or an error message.</p> |
| `search_issues` | <p>Searches for issues using a JQL query in JIRA. Parameters include:<br>- <code>jql\_str</code>: the JQL query string<br>- <code>max\_results</code>: the maximum number of results to return (default is 50)<br>Returns a JSON string containing a list of dictionaries with issue details or an error message.</p>                                                                |
| `add_comment`   | <p>Adds a comment to an issue in JIRA. Parameters include:<br>- <code>issue\_key</code>: the key of the issue<br>- <code>comment</code>: the comment text<br>Returns a JSON string indicating success or an error message.</p>                                                                                                                                                       |
