Skip to main content

Connect to Jira

Connect your Jira Cloud platform to Squid to query and create issues

Creating a Jira API key

Requests to the Jira REST API require an Authorization header. To authorize the requests to the Jira API from Squid, the Jira connector must be configured with an Atlassian API key. To create an API key, follow the steps in Atlassian's documentation to Create an API token. Make sure to copy this value as it is needed when adding the Jira connector.

Adding the Jira connector to your Squid application

  1. Navigate to the Integrations tab in the Squid Console.

  2. Click Available Integrations.

  3. Find the Jira integration, and select Add Integration.

  4. Provide the following configuration details:

Integration ID: A string that uniquely identifies the integration in the code.

Domain: The domain name of a Jira instance. The domain name is typically the first part of the URL used to access Jira. For example, if your Jira instance is at https://mycompany.atlassian.net, your domain would be mycompany.

API Key: The Atlassian API token created in the previous section.

The Jira connector's functionality

The Jira connector currently enables Squid AI agents to query Jira issues by a search string, query Jira issues using JQL (Jira Query Language), and create new issues. By providing AI agents with these capabilities, users can simply ask the AI agent to query or create new issues, and the agent will take the desired action.

If you are interested in learning more about how to use this feature, it is recommended to read the Jira REST API and JQL documentation. This will give users a better sense of what fields can be queried, what properties are necessary for creating an issue, and more.

While a better understanding of the underlying API will allow the user to use this feature more effectively, it is not a requirement as the AI agent will respond with messages indicating if requests are missing any required details.

Using the Jira connector in your application

To use the Jira connector in a Squid application, install the @squidcloud/jira npm package

npm install @squidcloud/jira

The Jira npm package provides AI functions used to call the Jira API. You will need to setup a Squid backend project in order to use the connector.

Exporting the Jira connector in the Squid backend adds the Jira AI functions to your project. In the src/service/index.ts, export the package in order to use it in your application.

export * from './example-service';
export * from '@squidcloud/jira';

In order to use the Jira AI functions, the AI agent must be connected to those functions. To do so, setup an AI agent profile in the Squid Console. If the backend is deployed, the AI agent will be able to access the Jira AI functions in the dropdown in the console. If the backend is not deployed, the AI functions must be provided to the AI agent in your code. For example, if using the Squid Chat Widget, the AI functions can be provided in the squid-ai-functions-json parameter of the widget.

const aiFunctionsJson = `[{"name": "searchJiraIssuesByText", "context": {"integrationId":"YOUR_INTEGRATION_ID"}}, {"name": "searchJiraIssuesByJQL", "context":  {"integrationId":"YOUR_INTEGRATION_ID"}}, {"name": "createJiraIssue", "context":  {"integrationId":"YOUR_INTEGRATION_ID"}}]`;

<squid-chat-widget>
squid-ai-integration-id=ai_agents;
squid-ai-profile-id=YOUR_PROFILE_ID;
squid-ai-functions-json={aiFunctionsJson}
squid-app-id='YOUR_APP_ID'
squid-region='YOUR_REGION'
squid-environment-id='YOUR_ENVIRONMENT'
squid-developer-id='YOUR_DEVELOPER_ID' {/* Include the developer ID when running backend locally */}
</squid-chat-widget>

Congratulations! You can now can ask questions to your AI agent about your Jira instance!