Create Jira AI Tools
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3555710. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
>>>
<h3>Summary</h3>
<p>We want to create a new tool-integration module for Tool API (available at <a href="https://www.drupal.org/project/tool">https://www.drupal.org/project/tool</a>) to enable interaction with Jira from within Drupal. The module will define reusable “tools” (function-like units of logic) that use Jira’s REST API to create and manage issues. It will require the Key module for storing the API credentials, and will integrate a settings page, permissions, and menu items. </p>
<p>We will reference the Tool API’s plugin-based approach and typed input/output schemas.</p>
<p>The integration should support basic operations like: create Jira issue, update Jira issue status, search Jira issues, etc. The module shall leverage an existing PHP client library if available; otherwise we will implement manual HTTP calls.</p>
<h3>Remaining tasks</h3>
<ul>
<li>Decide on PHP library:
<ul>
<li>Research available Jira PHP SDKs (for example via Packagist).</li>
<li>If one is suitable (up-to-date, supports REST endpoints needed), include as a composer dependency.</li>
<li>Otherwise plan manual HTTP requests via Guzzle (Drupal HTTP client) and map endpoints.</li>
</ul>
</li>
<li>Authentication & configuration:
<ul>
<li>Define configuration form under “Administration → Configuration → Services → Jira Integration”.</li>
<li>Add a Key module key type: e.g. “jira_api_key” and store via Key module. The config form should allow selecting the key and specify the base URL of the Jira instance.</li>
<li>Implement validation of credentials (e.g. test connection to Jira with the provided key during form submission).</li>
</ul>
</li>
<li>Permissions & menu items:
<ul>
<li>Create a permission: e.g. “Use Jira integration tools”.</li>
<li>Create menu item(s) for the settings form and a help/info page (e.g. under /admin/config/services/jira-integration - services).</li>
<li>Secure the settings page so only users with the permission can access it.</li>
</ul>
</li>
<li>Define Tool API tool plugins:
<ul>
<li>Tool: <strong>Create Jira Issue</strong>
<ul>
<li>Input: title (string, required) — the summary field in Jira</li>
<li>Input: description (string, optional) — issue description</li>
<li>Input: project_key (string, required) — Jira project key</li>
<li>Input: issue_type (string, required) — Jira issue type (e.g. Bug, Task)</li>
<li>Input: priority (string, optional) — Jira priority</li>
<li>Output: issue_id (string) — the newly created Jira issue key/ID</li>
</ul>
</li>
<li>Tool: <strong>Update Jira Issue Status</strong>
<ul>
<li>Input: issue_id (string, required) — Jira issue key/ID</li>
<li>Input: new_status (string, required) — status to transition to</li>
<li>Output: success (boolean) — whether the status update succeeded</li>
</ul>
</li>
<li>Tool: <strong>Search Jira Issues</strong>
<ul>
<li>Input: jql_query (string, required) — Jira Query Language string</li>
<li>Input: max_results (int, optional) — maximum results to return (default e.g. 50)</li>
<li>Output: issues (array) — list of issue objects (each with id, key, summary, status)</li>
</ul>
</li>
<li>Tool: <strong>View Jira Issue</strong>
<ul>
<li>Input: issue_id (string, required) — Jira issue key/ID</li>
<li>Output: issue details (string)</li>
</ul>
</li>
<li>Tool: <strong>Add Comment to Jira Issue</strong>
<ul>
<li>Input: issue_id (string, required) — Jira issue key/ID</li>
<li>Input: comment_text (string, required) — comment body</li>
<p> <output: comment_id id of the created comment>
</output:></p></ul>
</li>
</ul>
</li>
<li>Implement Tool API plugin classes:
<ul>
<li>Each plugin implements execution logic: retrieve configuration (base URL, API key) via config + Key service, then call Jira API using chosen client library or manual HTTP.</li>
<li>Handle error cases and return structured output (including error messages if needed).</li>
</ul>
</li>
</ul>
<p><strong>This issue was generated with the help of AI, but vetted before publishing.</strong></p>
issue