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 &ldquo;tools&rdquo; (function-like units of logic) that use Jira&rsquo;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&rsquo;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 &amp; configuration: <ul> <li>Define configuration form under &ldquo;Administration &rarr; Configuration &rarr; Services &rarr; Jira Integration&rdquo;.</li> <li>Add a Key module key type: e.g. &ldquo;jira_api_key&rdquo; 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 &amp; menu items: <ul> <li>Create a permission: e.g. &ldquo;Use Jira integration tools&rdquo;.</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) &mdash; the summary field in Jira</li> <li>Input: description (string, optional) &mdash; issue description</li> <li>Input: project_key (string, required) &mdash; Jira project key</li> <li>Input: issue_type (string, required) &mdash; Jira issue type (e.g. Bug, Task)</li> <li>Input: priority (string, optional) &mdash; Jira priority</li> <li>Output: issue_id (string) &mdash; 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) &mdash; Jira issue key/ID</li> <li>Input: new_status (string, required) &mdash; status to transition to</li> <li>Output: success (boolean) &mdash; whether the status update succeeded</li> </ul> </li> <li>Tool: <strong>Search Jira Issues</strong> <ul> <li>Input: jql_query (string, required) &mdash; Jira Query Language string</li> <li>Input: max_results (int, optional) &mdash; maximum results to return (default e.g. 50)</li> <li>Output: issues (array) &mdash; 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) &mdash; 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) &mdash; Jira issue key/ID</li> <li>Input: comment_text (string, required) &mdash; 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