Copybara import of the project:

--
e1c479d037d37e1ee1ddd86a4cd180f2692d952f by Karthigayan Devan <karthidec@gmail.com>:

add jira_agent adk samples code which connect Jira cloud

--
ef9fe57538252ad69f825f3ff77023b1f9eb004f by Karthigayan Devan <karthidec@gmail.com>:

update variables comment

--
f6adaaddd2decdd1e35aa06ba88031ec3b8a8521 by Karthigayan Devan <karthidec@gmail.com>:

renamed tool name to match exactly align with tool naming standard, removed keyword

--
150e63d4270b141e21195c5be7d67dce72e216fb by Karthigayan Devan <karthidec@gmail.com>:

updated tool and agent instructions

--
5048043195a5b1d397d9d439b3f6c6e650b4a6a3 by Karthigayan Devan <karthidec@gmail.com>:

add image application integration

--
bf3ee1553929d6d031f7b14f0b28f8f0ae7b84cc by Karthigayan Devan <karthidec@gmail.com>:

update read me instructions on configure app integration connector

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/785 from karthidec:adk-samples-jira-agent 2b984fa8c242e164541353b4597aebf4fd422288
PiperOrigin-RevId: 765351338
This commit is contained in:
Karthigayan Devan 2025-05-30 15:04:15 -07:00 committed by Copybara-Service
parent 7aaf811616
commit 8759a25251
7 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,25 @@
This agent connects to the Jira Cloud using Google Application Integration workflow and Integrations Connector
**Instructions to connect to an agent:**
**Use Integration Connectors**
Connect your agent to enterprise applications using [Integration Connectors](https://cloud.google.com/integration-connectors/docs/overview).
**Steps:**
1. To use a connector from Integration Connectors, you need to [provision](https://console.cloud.google.com/) Application Integration in the same region as your connection by clicking on "QUICK SETUP" button.
Google Cloud Tools
![image_alt](https://github.com/karthidec/adk-python/blob/adk-samples-jira-agent/contributing/samples/jira_agent/image-application-integration.png?raw=true)
2. Go to [Connection Tool]((https://console.cloud.google.com/)) template from the template library and click on "USE TEMPLATE" button.
![image_alt](https://github.com/karthidec/adk-python/blob/adk-samples-jira-agent/contributing/samples/jira_agent/image-connection-tool.png?raw=true)
3. Fill the Integration Name as **ExecuteConnection** (It is mandatory to use this integration name only) and select the region same as the connection region. Click on "CREATE".
4. Publish the integration by using the "PUBLISH" button on the Application Integration Editor.
![image_alt](https://github.com/karthidec/adk-python/blob/adk-samples-jira-agent/contributing/samples/jira_agent/image-app-intg-editor.png?raw=true)
**References:**
https://google.github.io/adk-docs/tools/google-cloud-tools/#application-integration-tools

View File

@ -0,0 +1,15 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from . import agent

View File

@ -0,0 +1,53 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from google.adk.agents import Agent
from .tools import jira_tool
root_agent = Agent(
model='gemini-2.0-flash-001',
name='jira_connector_agent',
description="This agent helps search issues in JIRA",
instruction="""
To start with, greet the user
First, you will be given a description of what you can do.
You the jira agent, who can help the user by fetching the jira issues based on the user query inputs
If an User wants to display all issues, then output only Key, Description, Summary, Status fields in a **clear table format** with key information. Example given below. Separate each line.
Example: {"key": "PROJ-123", "description": "This is a description", "summary": "This is a summary", "status": "In Progress"}
If an User wants to fetch on one specific key then use the LIST operation to fetch all Jira issues. Then filter locally to display only filtered result as per User given key input.
- **User query:** "give me the details of SMP-2"
- Output only Key, Description, Summary, Status fields in a **clear table format** with key information.
- **Output:** {"key": "PROJ-123", "description": "This is a description", "summary": "This is a summary", "status": "In Progress"}
Example scenarios:
- **User query:** "Can you show me all Jira issues with status `Done`?"
- **Output:** {"key": "PROJ-123", "description": "This is a description", "summary": "This is a summary", "status": "In Progress"}
- **User query:** "can you give details of SMP-2?"
- **Output:** {"key": "PROJ-123", "description": "This is a description", "summary": "This is a summary", "status": "In Progress"}
- **User query:** "Show issues with summary containing 'World'"
- **Output:** {"key": "PROJ-123", "description": "This is a description", "summary": "World", "status": "In Progress"}
- **User query:** "Show issues with description containing 'This is example task 3'"
- **Output:** {"key": "PROJ-123", "description": "This is example task 3", "summary": "World", "status": "In Progress"}
**Important Notes:**
- I currently support only **GET** and **LIST** operations.
""",
tools=jira_tool.get_tools(),
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,34 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from google.adk.tools.application_integration_tool.application_integration_toolset import ApplicationIntegrationToolset
jira_tool = ApplicationIntegrationToolset(
project="your-gcp-project-id", # replace with your GCP project ID
location="your-regions", # replace your regions
connection="your-integration-connection-name", #replace with your connection name
entity_operations={
"Issues": ["GET", "LIST"],
},
actions=[
"get_issue_by_key",
],
tool_name="jira_conversation_tool",
tool_instructions="""
This tool is to call an integration to search for issues in JIRA
""",
)