Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(jira-cloud): add agent actions and output schemas (#15726)

Kishan Parmar3db360e682ac
diff --git a/packages/pieces/community/jira-cloud/package.json b/packages/pieces/community/jira-cloud/package.json
index 23974013d6c..21d9e9f4785 100644
--- a/packages/pieces/community/jira-cloud/package.json
+++ b/packages/pieces/community/jira-cloud/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-jira-cloud",
- "version": "0.4.0",
+ "version": "0.5.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
diff --git a/packages/pieces/community/jira-cloud/src/index.ts b/packages/pieces/community/jira-cloud/src/index.ts
index 136cb4b818d..8377d38015b 100644
--- a/packages/pieces/community/jira-cloud/src/index.ts
+++ b/packages/pieces/community/jira-cloud/src/index.ts
@@ -28,13 +28,73 @@ import { newAttachment } from './lib/triggers/new-attachment';
import { newIssueType } from './lib/triggers/new-issue-type';
import { newProject } from './lib/triggers/new-project';
import { newPriority } from './lib/triggers/new-priority';
+import { addCommentAiAction } from './lib/actions/ai/add-comment';
+import { addWatcherAiAction } from './lib/actions/ai/add-watcher';
+import { addWorklogAiAction } from './lib/actions/ai/add-worklog';
+import { assignIssueToUserAiAction } from './lib/actions/ai/assign-issue-to-user';
+import { bulkCreateIssuesAiAction } from './lib/actions/ai/bulk-create-issues';
+import { bulkGetIssuesAiAction } from './lib/actions/ai/bulk-get-issues';
+import { countIssuesAiAction } from './lib/actions/ai/count-issues';
+import { createBoardAiAction } from './lib/actions/ai/create-board';
+import { createIssueLinkAiAction } from './lib/actions/ai/create-issue-link';
+import { createIssueWithFieldsAiAction } from './lib/actions/ai/create-issue-with-fields';
+import { createSprintAiAction } from './lib/actions/ai/create-sprint';
+import { deleteAttachmentAiAction } from './lib/actions/ai/delete-attachment';
+import { deleteCommentAiAction } from './lib/actions/ai/delete-comment';
+import { deleteIssueAiAction } from './lib/actions/ai/delete-issue';
+import { deleteWorklogAiAction } from './lib/actions/ai/delete-worklog';
+import { downloadAttachmentAiAction } from './lib/actions/ai/download-attachment';
+import { editIssueAiAction } from './lib/actions/ai/edit-issue';
+import { fetchIssueAiAction } from './lib/actions/ai/fetch-issue';
+import { findUsersAiAction } from './lib/actions/ai/find-users';
+import { getCommentAiAction } from './lib/actions/ai/get-comment';
+import { getCurrentUserAiAction } from './lib/actions/ai/get-current-user';
+import { getFavoriteFiltersAiAction } from './lib/actions/ai/get-favorite-filters';
+import { getFieldsAiAction } from './lib/actions/ai/get-fields';
+import { getFilterAiAction } from './lib/actions/ai/get-filter';
+import { getIssueEditMetadataAiAction } from './lib/actions/ai/get-issue-edit-metadata';
+import { getIssueLinkTypesAiAction } from './lib/actions/ai/get-issue-link-types';
+import { getIssueResolutionsAiAction } from './lib/actions/ai/get-issue-resolutions';
+import { getIssueTransitionsAiAction } from './lib/actions/ai/get-issue-transitions';
+import { getIssueTypeCreateFieldsAiAction } from './lib/actions/ai/get-issue-type-create-fields';
+import { getIssueTypesAiAction } from './lib/actions/ai/get-issue-types';
+import { getIssueVotesAiAction } from './lib/actions/ai/get-issue-votes';
+import { getIssueWatchersAiAction } from './lib/actions/ai/get-issue-watchers';
+import { getJqlFieldSuggestionsAiAction } from './lib/actions/ai/get-jql-field-suggestions';
+import { getJqlReferenceDataAiAction } from './lib/actions/ai/get-jql-reference-data';
+import { getMyPermissionsAiAction } from './lib/actions/ai/get-my-permissions';
+import { getPermittedProjectsAiAction } from './lib/actions/ai/get-permitted-projects';
+import { getPrioritiesAiAction } from './lib/actions/ai/get-priorities';
+import { getProjectComponentsAiAction } from './lib/actions/ai/get-project-components';
+import { getProjectVersionsAiAction } from './lib/actions/ai/get-project-versions';
+import { getProjectAiAction } from './lib/actions/ai/get-project';
+import { getRecentProjectsAiAction } from './lib/actions/ai/get-recent-projects';
+import { getRemoteIssueLinksAiAction } from './lib/actions/ai/get-remote-issue-links';
+import { getSprintAiAction } from './lib/actions/ai/get-sprint';
+import { getStatusesAiAction } from './lib/actions/ai/get-statuses';
+import { getUserGroupsAiAction } from './lib/actions/ai/get-user-groups';
+import { getWorklogsAiAction } from './lib/actions/ai/get-worklogs';
+import { listBoardsAiAction } from './lib/actions/ai/list-boards';
+import { listCommentsAiAction } from './lib/actions/ai/list-comments';
+import { listProjectsAiAction } from './lib/actions/ai/list-projects';
+import { listSprintsAiAction } from './lib/actions/ai/list-sprints';
+import { moveIssuesToSprintAiAction } from './lib/actions/ai/move-issues-to-sprint';
+import { parseJqlAiAction } from './lib/actions/ai/parse-jql';
+import { removeWatcherAiAction } from './lib/actions/ai/remove-watcher';
+import { searchDashboardsAiAction } from './lib/actions/ai/search-dashboards';
+import { searchFiltersAiAction } from './lib/actions/ai/search-filters';
+import { searchIssuesByJqlAiAction } from './lib/actions/ai/search-issues-by-jql';
+import { sendIssueNotificationAiAction } from './lib/actions/ai/send-issue-notification';
+import { transitionIssueStatusAiAction } from './lib/actions/ai/transition-issue-status';
+import { updateCommentAiAction } from './lib/actions/ai/update-comment';
+import { uploadAttachmentAiAction } from './lib/actions/ai/upload-attachment';
export const jiraCloud = createPiece({
displayName: 'Jira Cloud',
description: 'Issue tracking and project management',
auth: jiraCloudAuth,
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.87.0',
logoUrl: 'https://cdn.activepieces.com/pieces/jira.png',
categories: [PieceCategory.PRODUCTIVITY],
authors: ['kishanprmr', 'MoShizzle', 'abuaboud', 'prasanna2000-max', 'sanket-a11y'],
@@ -55,6 +115,66 @@ export const jiraCloud = createPiece({
markdownToJiraFormat,
getIssueAction,
transitionIssueAction,
+ addCommentAiAction,
+ addWatcherAiAction,
+ addWorklogAiAction,
+ assignIssueToUserAiAction,
+ bulkCreateIssuesAiAction,
+ bulkGetIssuesAiAction,
+ countIssuesAiAction,
+ createBoardAiAction,
+ createIssueLinkAiAction,
+ createIssueWithFieldsAiAction,
+ createSprintAiAction,
+ deleteAttachmentAiAction,
+ deleteCommentAiAction,
+ deleteIssueAiAction,
+ deleteWorklogAiAction,
+ downloadAttachmentAiAction,
+ editIssueAiAction,
+ fetchIssueAiAction,
+ findUsersAiAction,
+ getCommentAiAction,
+ getCurrentUserAiAction,
+ getFavoriteFiltersAiAction,
+ getFieldsAiAction,
+ getFilterAiAction,
+ getIssueEditMetadataAiAction,
+ getIssueLinkTypesAiAction,
+ getIssueResolutionsAiAction,
+ getIssueTransitionsAiAction,
+ getIssueTypeCreateFieldsAiAction,
+ getIssueTypesAiAction,
+ getIssueVotesAiAction,
+ getIssueWatchersAiAction,
+ getJqlFieldSuggestionsAiAction,
+ getJqlReferenceDataAiAction,
+ getMyPermissionsAiAction,
+ getPermittedProjectsAiAction,
+ getPrioritiesAiAction,
+ getProjectComponentsAiAction,
+ getProjectVersionsAiAction,
+ getProjectAiAction,
+ getRecentProjectsAiAction,
+ getRemoteIssueLinksAiAction,
+ getSprintAiAction,
+ getStatusesAiAction,
+ getUserGroupsAiAction,
+ getWorklogsAiAction,
+ listBoardsAiAction,
+ listCommentsAiAction,
+ listProjectsAiAction,
+ listSprintsAiAction,
+ moveIssuesToSprintAiAction,
+ parseJqlAiAction,
+ removeWatcherAiAction,
+ searchDashboardsAiAction,
+ searchFiltersAiAction,
+ searchIssuesByJqlAiAction,
+ sendIssueNotificationAiAction,
+ transitionIssueStatusAiAction,
+ updateCommentAiAction,
+ uploadAttachmentAiAction,
createCustomApiCallAction({
baseUrl: (auth) => {
return auth ? `${(auth).props.instanceUrl}/rest/api/3` : '';
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/add-attachment-to-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/add-attachment-to-issue.ts
index eb2d51419b1..565a866bab7 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/add-attachment-to-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/add-attachment-to-issue.ts
@@ -5,17 +5,19 @@ import { sendJiraRequest } from '../common';
import FormData from 'form-data';
import { getProjectIdDropdown, getIssueIdDropdown } from '../common/props';
+import { legacyAttachmentListOutputSchema } from '../output-schemas';
export const addAttachmentToIssueAction = createAction({
auth: jiraCloudAuth,
name: 'add_issue_attachment',
displayName: 'Add Attachment to Issue',
description: 'Adds an attachment to an issue.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Upload a file as an attachment on an existing Jira issue, identified by project and issue. Use when a file (image, log, document) needs to be stored on the issue itself rather than referenced in a comment. Not idempotent: re-running uploads a duplicate copy of the same file.',
idempotent: false,
},
+ outputSchema: legacyAttachmentListOutputSchema,
props: {
projectId: getProjectIdDropdown(),
issueId: getIssueIdDropdown({ refreshers: ['projectId'] }),
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/add-comment-to-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/add-comment-to-issue.ts
index 0aa94f5d244..343aa5b0bce 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/add-comment-to-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/add-comment-to-issue.ts
@@ -4,17 +4,19 @@ import { HttpMethod } from '@activepieces/pieces-common';
import { sendJiraRequest } from '../common';
import { getIssueIdDropdown, getProjectIdDropdown } from '../common/props';
+import { commentOutputSchema } from '../output-schemas';
export const addCommentToIssueAction = createAction({
auth: jiraCloudAuth,
name: 'add_issue_comment',
displayName: 'Add Issue Comment',
description: 'Adds a comment to an issue.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Post a new comment on an existing Jira issue. Accepts plain text by default, or raw Atlassian Document Format (ADF) JSON when the ADF flag is set — use the Markdown to Jira Format action to produce ADF from markdown. Not idempotent: each run appends another comment.',
idempotent: false,
},
+ outputSchema: commentOutputSchema,
props: {
projectId: getProjectIdDropdown(),
issueId: getIssueIdDropdown({ refreshers: ['projectId'] }),
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/add-watcher-to-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/add-watcher-to-issue.ts
index 517b0ad5056..abb1fee8c43 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/add-watcher-to-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/add-watcher-to-issue.ts
@@ -5,17 +5,19 @@ import { isNil } from '@activepieces/pieces-framework';
import { jiraApiCall } from '../common';
import { HttpError, HttpMethod } from '@activepieces/pieces-common';
+import { legacyAddWatcherOutputSchema } from '../output-schemas';
export const addWatcherToIssueAction = createAction({
auth: jiraCloudAuth,
name: 'add-watcher-to-issue',
displayName: 'Add Watcher to Issue',
description: 'Adds a new watcher to an issue.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Subscribe a specific user as a watcher on a Jira issue (by issue ID/key and user account) so they get notifications about its updates. Use to loop someone in without assigning or commenting. Effectively idempotent: adding a user who already watches the issue leaves it unchanged.',
idempotent: true,
},
+ outputSchema: legacyAddWatcherOutputSchema,
props: {
issueId: issueIdOrKeyProp('Issue ID or Key', true),
userId: getUsersDropdown({
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-comment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-comment.ts
new file mode 100644
index 00000000000..ba454d868de
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-comment.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { commentOutputSchema } from '../../output-schemas';
+export const addCommentAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'add_comment',
+ classification: 'WRITE',
+ displayName: 'Add Comment',
+ description: 'Adds a comment to an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Post a new comment on an issue. The text is written in markdown and converted to Jira rich text automatically, so no separate conversion step is needed. Not idempotent: each call adds another comment, so check List Comments before retrying.',
+ idempotent: false,
+ },
+ outputSchema: commentOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ comment: jiraAiProps.markdownText({ displayName: 'Comment', description: 'The comment text.' }),
+ },
+ async run({ auth, propsValue }) {
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/comment`,
+ body: { body: jiraAiHelpers.markdownToAdf({ markdown: propsValue.comment }) },
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-watcher.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-watcher.ts
new file mode 100644
index 00000000000..f7e3d4f8844
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-watcher.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { watcherChangeOutputSchema } from '../../output-schemas';
+export const addWatcherAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'add_watcher',
+ classification: 'WRITE',
+ displayName: 'Add Watcher',
+ description: 'Adds a user to the watchers of an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Add one user, by account ID, to the watcher list of an issue so they get its notifications. Adding someone other than yourself needs the Manage watcher list permission. Idempotent: adding an existing watcher changes nothing.',
+ idempotent: true,
+ },
+ outputSchema: watcherChangeOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ accountId: jiraAiProps.accountId(),
+ },
+ async run({ auth, propsValue }) {
+ const issueIdOrKey = propsValue.issueIdOrKey.trim();
+ const accountId = propsValue.accountId.trim();
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}/watchers`,
+ body: JSON.stringify(accountId),
+ });
+ return { success: true, issue: issueIdOrKey, account_id: accountId };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-worklog.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-worklog.ts
new file mode 100644
index 00000000000..a9ab14af6e9
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/add-worklog.ts
@@ -0,0 +1,83 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import dayjs from 'dayjs';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { worklogOutputSchema } from '../../output-schemas';
+export const addWorklogAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'add_worklog',
+ classification: 'WRITE',
+ displayName: 'Add Worklog',
+ description: 'Logs time spent on an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Log time spent on an issue as a worklog entry, with an optional start time and comment, adjusting the remaining estimate automatically unless told otherwise. Time tracking must be enabled on the site. Not idempotent: each call adds another entry, so use Get Worklogs to check before retrying.',
+ idempotent: false,
+ },
+ outputSchema: worklogOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ timeSpent: Property.ShortText({
+ displayName: 'Time Spent',
+ description: 'Time spent in Jira duration format, e.g. 3h 20m, 1d, 45m.',
+ required: true,
+ }),
+ started: Property.DateTime({
+ displayName: 'Started',
+ description: 'When the work started (ISO 8601). Defaults to now.',
+ required: false,
+ }),
+ comment: jiraAiProps.optionalMarkdownText({ displayName: 'Comment', description: 'Optional description of the work done.' }),
+ adjustEstimate: Property.StaticDropdown({
+ displayName: 'Adjust Remaining Estimate',
+ description: 'How to update the remaining estimate. Defaults to auto (reduce by the time spent).',
+ required: false,
+ options: {
+ options: [
+ { label: 'Auto (reduce by time spent)', value: 'auto' },
+ { label: 'Leave unchanged', value: 'leave' },
+ { label: 'Set to New Estimate', value: 'new' },
+ { label: 'Reduce by Reduce By', value: 'manual' },
+ ],
+ },
+ }),
+ newEstimate: Property.ShortText({
+ displayName: 'New Estimate',
+ description: 'New remaining estimate, e.g. 2d. Required when Adjust Remaining Estimate is Set to New Estimate.',
+ required: false,
+ }),
+ reduceBy: Property.ShortText({
+ displayName: 'Reduce By',
+ description: 'Amount to reduce the remaining estimate by, e.g. 2h. Required when Adjust Remaining Estimate is Reduce by Reduce By.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const started = jiraAiHelpers.isProvided(propsValue.started) ? dayjs(propsValue.started) : dayjs();
+ if (!started.isValid()) {
+ throw new Error('Started must be a valid ISO 8601 date-time.');
+ }
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/worklog`,
+ query: {
+ adjustEstimate: propsValue.adjustEstimate,
+ newEstimate: propsValue.adjustEstimate === 'new' ? propsValue.newEstimate : undefined,
+ reduceBy: propsValue.adjustEstimate === 'manual' ? propsValue.reduceBy : undefined,
+ },
+ body: {
+ timeSpent: propsValue.timeSpent.trim(),
+ started: started.format(JIRA_DATE_TIME_FORMAT),
+ ...(jiraAiHelpers.isProvided(propsValue.comment) ? { comment: jiraAiHelpers.markdownToAdf({ markdown: propsValue.comment }) } : {}),
+ },
+ });
+ },
+});
+
+const JIRA_DATE_TIME_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZZ';
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/assign-issue-to-user.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/assign-issue-to-user.ts
new file mode 100644
index 00000000000..1a13a73f24c
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/assign-issue-to-user.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { assignIssueToUserOutputSchema } from '../../output-schemas';
+export const assignIssueToUserAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'assign_issue_to_user',
+ classification: 'WRITE',
+ displayName: 'Assign Issue to User',
+ description: 'Assigns or unassigns an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Assign an issue to a user by account ID, or unassign it by leaving the account ID empty. Resolve a name or email to an account ID with Find Users, or use Get Current User for yourself. The user must be assignable in the project. Idempotent: assigning the same user again changes nothing.',
+ idempotent: true,
+ },
+ outputSchema: assignIssueToUserOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ accountId: Property.ShortText({
+ displayName: 'Assignee Account ID',
+ description: 'Account ID of the new assignee. Leave empty to unassign the issue.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const issueIdOrKey = propsValue.issueIdOrKey.trim();
+ const accountId = jiraAiHelpers.isProvided(propsValue.accountId) ? propsValue.accountId.trim() : null;
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.PUT,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}/assignee`,
+ body: { accountId },
+ });
+ return { success: true, issue: issueIdOrKey, assignee_account_id: accountId };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/bulk-create-issues.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/bulk-create-issues.ts
new file mode 100644
index 00000000000..3ae94ff4431
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/bulk-create-issues.ts
@@ -0,0 +1,83 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { bulkCreateIssuesOutputSchema } from '../../output-schemas';
+export const bulkCreateIssuesAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'bulk_create_issues',
+ classification: 'WRITE',
+ displayName: 'Bulk Create Issues',
+ description: 'Creates up to 50 issues in one request.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Create up to 50 issues in one project in a single request, each with its own summary, issue type and optional fields. Use it instead of repeated Create Issue with Fields calls when adding many issues; failures are reported per issue while the rest are still created. Not idempotent: each run creates new issues.',
+ idempotent: false,
+ },
+ outputSchema: bulkCreateIssuesOutputSchema,
+ props: {
+ projectIdOrKey: jiraAiProps.projectIdOrKey({ description: 'The project key (e.g. PROJ) or numeric project ID that every issue is created in. Find it with List Projects.' }),
+ issues: Property.Json({
+ displayName: 'Issues',
+ description:
+ 'JSON array (1-50 items). Each item: {"summary": string, "issueTypeId": string, "description"?: markdown string, "assigneeAccountId"?: string, "priorityId"?: string, "labels"?: string[], "parentKey"?: string, "dueDate"?: "YYYY-MM-DD", "fields"?: object of extra field IDs to values}. Issue type IDs come from Get Issue Types.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const issues = jiraAiHelpers.toRecordList({ value: propsValue.issues, label: 'Issues' });
+ if (issues.length === 0 || issues.length > MAX_ISSUES) {
+ throw new Error(`Issues must contain between 1 and ${MAX_ISSUES} items.`);
+ }
+ const issueUpdates = issues.map((issue, index) => ({
+ fields: jiraAiHelpers.buildIssueFields({
+ projectIdOrKey: propsValue.projectIdOrKey,
+ issueTypeId: requiredText({ value: issue['issueTypeId'], label: `issues[${index}].issueTypeId` }),
+ summary: requiredText({ value: issue['summary'], label: `issues[${index}].summary` }),
+ description: optionalText({ value: issue['description'] }),
+ assigneeAccountId: optionalText({ value: issue['assigneeAccountId'] }),
+ priorityId: optionalText({ value: issue['priorityId'] }),
+ labels: jiraAiHelpers.toStringList({ value: issue['labels'] }),
+ parentKey: optionalText({ value: issue['parentKey'] }),
+ dueDate: optionalText({ value: issue['dueDate'] }),
+ extraFields: jiraAiHelpers.toRecord({ value: issue['fields'], label: `issues[${index}].fields` }),
+ }),
+ }));
+ const response = await jiraApiCall<BulkCreateResponse>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: '/issue/bulk',
+ body: { issueUpdates },
+ });
+ const created = response.issues ?? [];
+ const errors = response.errors ?? [];
+ return {
+ issues: created,
+ errors,
+ created_count: created.length,
+ failed_count: errors.length,
+ };
+ },
+});
+
+function requiredText({ value, label }: { value: unknown; label: string }): string {
+ if (typeof value !== 'string' && typeof value !== 'number') {
+ throw new Error(`${label} is required.`);
+ }
+ return String(value);
+}
+
+function optionalText({ value }: { value: unknown }): string | undefined {
+ return typeof value === 'string' || typeof value === 'number' ? String(value) : undefined;
+}
+
+const MAX_ISSUES = 50;
+
+type BulkCreateResponse = {
+ issues?: JiraRecord[];
+ errors?: JiraRecord[];
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/bulk-get-issues.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/bulk-get-issues.ts
new file mode 100644
index 00000000000..1da537409b4
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/bulk-get-issues.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { bulkGetIssuesOutputSchema } from '../../output-schemas';
+export const bulkGetIssuesAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'bulk_get_issues',
+ classification: 'READ',
+ displayName: 'Bulk Get Issues',
+ description: 'Fetches up to 100 issues by ID or key in one request.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Fetch up to 100 known issues by key or ID in a single request, optionally limiting the returned fields. Use it when you already hold a list of issue keys; to find issues by criteria use Search Issues by JQL. Keys that do not exist or are not visible are left out of issues without an error, so compare the returned keys with the requested ones. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: bulkGetIssuesOutputSchema,
+ props: {
+ issueIdsOrKeys: Property.Array({
+ displayName: 'Issue IDs or Keys',
+ description: 'Up to 100 issue keys (e.g. PROJ-123) or numeric issue IDs.',
+ required: true,
+ }),
+ fields: Property.Array({
+ displayName: 'Fields',
+ description: 'Field IDs to return, e.g. summary, status, assignee, customfield_10016. Leave empty for all navigable fields.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const issueIdsOrKeys = jiraAiHelpers.toStringList({ value: propsValue.issueIdsOrKeys });
+ if (issueIdsOrKeys.length === 0 || issueIdsOrKeys.length > MAX_ISSUES) {
+ throw new Error(`Issue IDs or Keys must contain between 1 and ${MAX_ISSUES} items.`);
+ }
+ const fields = jiraAiHelpers.toStringList({ value: propsValue.fields });
+ const response = await jiraApiCall<BulkFetchResponse>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: '/issue/bulkfetch',
+ body: {
+ issueIdsOrKeys,
+ ...(fields.length > 0 ? { fields } : {}),
+ },
+ });
+ const issues = response.issues ?? [];
+ return { issues, issue_errors: response.issueErrors ?? [], count: issues.length };
+ },
+});
+
+const MAX_ISSUES = 100;
+
+type BulkFetchResponse = {
+ issues?: JiraRecord[];
+ issueErrors?: JiraRecord[];
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/count-issues.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/count-issues.ts
new file mode 100644
index 00000000000..f562a5bfa79
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/count-issues.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+
+import { countIssuesOutputSchema } from '../../output-schemas';
+export const countIssuesAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'count_issues',
+ classification: 'SEARCH',
+ displayName: 'Count Issues',
+ description: 'Returns an approximate count of issues matching a JQL query.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Return an approximate count of the issues matching a JQL query without fetching them. Use it for totals and reporting; to read the issues use Search Issues by JQL. The JQL must be bounded by at least one restriction such as a project, assignee or date clause, otherwise Jira rejects it. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: countIssuesOutputSchema,
+ props: {
+ jql: Property.LongText({
+ displayName: 'JQL',
+ description: 'A bounded JQL query, e.g. project = PROJ AND status = "In Progress".',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<{ count: number }>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: '/search/approximate-count',
+ body: { jql: propsValue.jql },
+ });
+ return { count: response.count, jql: propsValue.jql };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-board.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-board.ts
new file mode 100644
index 00000000000..967dc218a06
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-board.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { boardOutputSchema } from '../../output-schemas';
+export const createBoardAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'create_board',
+ classification: 'WRITE',
+ displayName: 'Create Board',
+ description: 'Creates a Scrum or Kanban board from a saved filter.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Create a Scrum or Kanban board whose issues come from an existing saved filter, optionally placing it in a project. The filter ID comes from Search Filters, and the user must be able to see that filter. Requires Jira Software. Not idempotent: each call creates another board.',
+ idempotent: false,
+ },
+ outputSchema: boardOutputSchema,
+ props: {
+ name: Property.ShortText({
+ displayName: 'Name',
+ required: true,
+ }),
+ type: Property.StaticDropdown({
+ displayName: 'Board Type',
+ required: true,
+ options: {
+ options: [
+ { label: 'Scrum', value: 'scrum' },
+ { label: 'Kanban', value: 'kanban' },
+ ],
+ },
+ }),
+ filterId: Property.Number({
+ displayName: 'Filter ID',
+ description: 'ID of the saved filter that selects the board issues. Find it with Search Filters.',
+ required: true,
+ }),
+ projectKeyOrId: Property.ShortText({
+ displayName: 'Project ID or Key',
+ description: 'Project to place the board in. Leave empty to create it in the user profile.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await httpClient.sendRequest<JiraRecord>({
+ method: HttpMethod.POST,
+ url: `${auth.props.instanceUrl}/rest/agile/1.0/board`,
+ authentication: {
+ type: AuthenticationType.BASIC,
+ username: auth.props.email,
+ password: auth.props.apiToken,
+ },
+ body: {
+ name: propsValue.name,
+ type: propsValue.type,
+ filterId: propsValue.filterId,
+ ...(jiraAiHelpers.isProvided(propsValue.projectKeyOrId)
+ ? { location: { type: 'project', projectKeyOrId: propsValue.projectKeyOrId.trim() } }
+ : {}),
+ },
+ });
+ return response.body;
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-issue-link.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-issue-link.ts
new file mode 100644
index 00000000000..c48f0eef2b8
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-issue-link.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { createIssueLinkOutputSchema } from '../../output-schemas';
+export const createIssueLinkAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'create_issue_link',
+ classification: 'WRITE',
+ displayName: 'Create Issue Link',
+ description: 'Links two issues with a link type.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Link two issues with a named link type such as Blocks, Relates or Duplicates, with an optional comment on the inward issue. Direction matters: the outward issue gets the outward wording (e.g. "blocks") and the inward issue the inward wording (e.g. "is blocked by"); get valid names and wording from Get Issue Link Types. Not idempotent: Jira may add a duplicate link.',
+ idempotent: false,
+ },
+ outputSchema: createIssueLinkOutputSchema,
+ props: {
+ linkTypeName: Property.ShortText({
+ displayName: 'Link Type Name',
+ description: 'Name of the link type, e.g. Blocks. Find it with Get Issue Link Types.',
+ required: true,
+ }),
+ outwardIssueKey: jiraAiProps.issueIdOrKey({
+ displayName: 'Outward Issue Key',
+ description: 'The issue on the outward side, e.g. the issue that blocks the other one.',
+ }),
+ inwardIssueKey: jiraAiProps.issueIdOrKey({
+ displayName: 'Inward Issue Key',
+ description: 'The issue on the inward side, e.g. the issue that is blocked.',
+ }),
+ comment: jiraAiProps.optionalMarkdownText({ displayName: 'Comment', description: 'Optional comment added to the inward issue.' }),
+ },
+ async run({ auth, propsValue }) {
+ const outwardIssueKey = propsValue.outwardIssueKey.trim();
+ const inwardIssueKey = propsValue.inwardIssueKey.trim();
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: '/issueLink',
+ body: {
+ type: { name: propsValue.linkTypeName.trim() },
+ outwardIssue: { key: outwardIssueKey },
+ inwardIssue: { key: inwardIssueKey },
+ ...(jiraAiHelpers.isProvided(propsValue.comment)
+ ? { comment: { body: jiraAiHelpers.markdownToAdf({ markdown: propsValue.comment }) } }
+ : {}),
+ },
+ });
+ return {
+ success: true,
+ link_type: propsValue.linkTypeName.trim(),
+ outward_issue: outwardIssueKey,
+ inward_issue: inwardIssueKey,
+ };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-issue-with-fields.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-issue-with-fields.ts
new file mode 100644
index 00000000000..67add3f7145
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-issue-with-fields.ts
@@ -0,0 +1,98 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { createdIssueOutputSchema } from '../../output-schemas';
+export const createIssueWithFieldsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'create_issue_with_fields',
+ classification: 'WRITE',
+ displayName: 'Create Issue with Fields',
+ description: 'Creates an issue from a project, issue type, summary and optional fields.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Create one issue in a project with a summary, issue type and optional description, assignee, priority, labels, parent, due date and any custom fields by field ID. Get the issue type ID from Get Issue Types and the required custom fields from Get Issue Type Create Fields; for many issues at once use Bulk Create Issues. Not idempotent: each call creates a new issue.',
+ idempotent: false,
+ },
+ outputSchema: createdIssueOutputSchema,
+ props: {
+ projectIdOrKey: jiraAiProps.projectIdOrKey(),
+ issueTypeId: Property.ShortText({
+ displayName: 'Issue Type ID',
+ description: 'The numeric issue type ID. Find it with Get Issue Types.',
+ required: true,
+ }),
+ summary: Property.ShortText({
+ displayName: 'Summary',
+ required: true,
+ }),
+ description: jiraAiProps.optionalMarkdownText({ displayName: 'Description', description: 'Issue description.' }),
+ assigneeAccountId: Property.ShortText({
+ displayName: 'Assignee Account ID',
+ description: 'Account ID of the assignee. Resolve it with Find Users.',
+ required: false,
+ }),
+ priorityId: Property.ShortText({
+ displayName: 'Priority ID',
+ description: 'The priority ID. Find it with Get Priorities.',
+ required: false,
+ }),
+ labels: Property.Array({
+ displayName: 'Labels',
+ description: 'Labels to add. Labels cannot contain spaces.',
+ required: false,
+ }),
+ parentKey: Property.ShortText({
+ displayName: 'Parent Issue Key',
+ description: 'Key of the parent issue or epic. Required when the issue type is a subtask.',
+ required: false,
+ }),
+ dueDate: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'Due date in YYYY-MM-DD format.',
+ required: false,
+ }),
+ fields: Property.Json({
+ displayName: 'Additional Fields',
+ description:
+ 'JSON object of other field IDs to values in Jira REST format, e.g. {"customfield_10016": 5, "components": [{"id": "10000"}], "fixVersions": [{"id": "10001"}]}. Field IDs come from Get Fields or Get Issue Type Create Fields.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const fields = jiraAiHelpers.buildIssueFields({
+ projectIdOrKey: propsValue.projectIdOrKey,
+ issueTypeId: propsValue.issueTypeId,
+ summary: propsValue.summary,
+ description: propsValue.description,
+ assigneeAccountId: propsValue.assigneeAccountId,
+ priorityId: propsValue.priorityId,
+ labels: jiraAiHelpers.toStringList({ value: propsValue.labels }),
+ parentKey: propsValue.parentKey,
+ dueDate: propsValue.dueDate,
+ extraFields: jiraAiHelpers.toRecord({ value: propsValue.fields, label: 'Additional Fields' }),
+ });
+ const created = await jiraApiCall<CreatedIssue>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: '/issue',
+ body: { fields },
+ });
+ return {
+ id: created.id,
+ key: created.key,
+ self: created.self,
+ browse_url: jiraAiHelpers.browseUrl({ auth, issueKey: created.key }),
+ };
+ },
+});
+
+type CreatedIssue = {
+ id: string;
+ key: string;
+ self: string;
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-sprint.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-sprint.ts
new file mode 100644
index 00000000000..effed0ffc19
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/create-sprint.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { sprintOutputSchema } from '../../output-schemas';
+export const createSprintAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'create_sprint',
+ classification: 'WRITE',
+ displayName: 'Create Sprint',
+ description: 'Creates a future sprint on a Scrum board.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Create a sprint on a Scrum board with optional start date, end date and goal. The sprint is always created in the future state; starting it is done in Jira. Board IDs come from List Boards. Not idempotent: each call creates another sprint.',
+ idempotent: false,
+ },
+ outputSchema: sprintOutputSchema,
+ props: {
+ name: Property.ShortText({
+ displayName: 'Name',
+ required: true,
+ }),
+ originBoardId: Property.Number({
+ displayName: 'Board ID',
+ description: 'The numeric ID of the Scrum board. Find it with List Boards.',
+ required: true,
+ }),
+ startDate: Property.DateTime({
+ displayName: 'Start Date',
+ description: 'Planned start (ISO 8601).',
+ required: false,
+ }),
+ endDate: Property.DateTime({
+ displayName: 'End Date',
+ description: 'Planned end (ISO 8601).',
+ required: false,
+ }),
+ goal: Property.LongText({
+ displayName: 'Goal',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await httpClient.sendRequest<JiraRecord>({
+ method: HttpMethod.POST,
+ url: `${auth.props.instanceUrl}/rest/agile/1.0/sprint`,
+ authentication: {
+ type: AuthenticationType.BASIC,
+ username: auth.props.email,
+ password: auth.props.apiToken,
+ },
+ body: {
+ name: propsValue.name,
+ originBoardId: propsValue.originBoardId,
+ ...(jiraAiHelpers.isProvided(propsValue.startDate) ? { startDate: propsValue.startDate } : {}),
+ ...(jiraAiHelpers.isProvided(propsValue.endDate) ? { endDate: propsValue.endDate } : {}),
+ ...(jiraAiHelpers.isProvided(propsValue.goal) ? { goal: propsValue.goal } : {}),
+ },
+ });
+ return response.body;
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-attachment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-attachment.ts
new file mode 100644
index 00000000000..f14fcd433a9
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-attachment.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+
+import { deleteAttachmentOutputSchema } from '../../output-schemas';
+export const deleteAttachmentAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'delete_attachment',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Attachment',
+ description: 'Permanently deletes an attachment.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently delete an attachment from its issue by attachment ID. This cannot be undone, so confirm with the user first. Attachment IDs are in the attachment field of Fetch Issue. Not idempotent: a retry returns not found.',
+ idempotent: false,
+ },
+ outputSchema: deleteAttachmentOutputSchema,
+ props: {
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'The numeric attachment ID, from the attachment field of Fetch Issue.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const attachmentId = propsValue.attachmentId.trim();
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.DELETE,
+ resourceUri: `/attachment/${encodeURIComponent(attachmentId)}`,
+ });
+ return { success: true, attachment_id: attachmentId, deleted: true };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-comment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-comment.ts
new file mode 100644
index 00000000000..1a3f2b4fbf1
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-comment.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { deleteCommentOutputSchema } from '../../output-schemas';
+export const deleteCommentAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'delete_comment',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Comment',
+ description: 'Permanently deletes a comment from an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently delete one comment from an issue. This cannot be undone; to change the text use Update Comment instead. Comment IDs come from List Comments. Not idempotent: a retry returns not found.',
+ idempotent: false,
+ },
+ outputSchema: deleteCommentOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'The numeric comment ID. Find it with List Comments.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const issueIdOrKey = propsValue.issueIdOrKey.trim();
+ const commentId = propsValue.commentId.trim();
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.DELETE,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}/comment/${encodeURIComponent(commentId)}`,
+ });
+ return { success: true, issue: issueIdOrKey, comment_id: commentId, deleted: true };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-issue.ts
new file mode 100644
index 00000000000..8280478c28d
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-issue.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { deleteIssueOutputSchema } from '../../output-schemas';
+export const deleteIssueAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'delete_issue',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Issue',
+ description: 'Permanently deletes an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently delete a Jira issue and, if requested, its subtasks. This cannot be undone, so confirm with the user first; to close an issue instead, use Transition Issue Status. Fails when the issue has subtasks and Delete Subtasks is off. Not idempotent: a retry returns not found.',
+ idempotent: false,
+ },
+ outputSchema: deleteIssueOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ deleteSubtasks: Property.Checkbox({
+ displayName: 'Delete Subtasks',
+ description: 'Also delete the subtasks of the issue. Required when the issue has subtasks.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const issueIdOrKey = propsValue.issueIdOrKey.trim();
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.DELETE,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}`,
+ query: { deleteSubtasks: String(propsValue.deleteSubtasks === true) },
+ });
+ return { success: true, issue: issueIdOrKey, deleted: true };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-worklog.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-worklog.ts
new file mode 100644
index 00000000000..2b51ef5f3fa
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/delete-worklog.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { deleteWorklogOutputSchema } from '../../output-schemas';
+export const deleteWorklogAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'delete_worklog',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Worklog',
+ description: 'Deletes a worklog from an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently delete one worklog entry from an issue, restoring the logged time to the remaining estimate automatically unless told otherwise. Worklog IDs come from Get Worklogs. Not idempotent: a retry returns not found.',
+ idempotent: false,
+ },
+ outputSchema: deleteWorklogOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ worklogId: Property.ShortText({
+ displayName: 'Worklog ID',
+ description: 'The numeric worklog ID. Find it with Get Worklogs.',
+ required: true,
+ }),
+ adjustEstimate: Property.StaticDropdown({
+ displayName: 'Adjust Remaining Estimate',
+ description: 'How to update the remaining estimate. Defaults to auto (increase by the deleted time).',
+ required: false,
+ options: {
+ options: [
+ { label: 'Auto (increase by deleted time)', value: 'auto' },
+ { label: 'Leave unchanged', value: 'leave' },
+ { label: 'Set to New Estimate', value: 'new' },
+ { label: 'Increase by Increase By', value: 'manual' },
+ ],
+ },
+ }),
+ newEstimate: Property.ShortText({
+ displayName: 'New Estimate',
+ description: 'New remaining estimate, e.g. 2d. Required when Adjust Remaining Estimate is Set to New Estimate.',
+ required: false,
+ }),
+ increaseBy: Property.ShortText({
+ displayName: 'Increase By',
+ description: 'Amount to increase the remaining estimate by, e.g. 2h. Required when Adjust Remaining Estimate is Increase by Increase By.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const issueIdOrKey = propsValue.issueIdOrKey.trim();
+ const worklogId = propsValue.worklogId.trim();
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.DELETE,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}/worklog/${encodeURIComponent(worklogId)}`,
+ query: {
+ adjustEstimate: propsValue.adjustEstimate,
+ newEstimate: propsValue.adjustEstimate === 'new' ? propsValue.newEstimate : undefined,
+ increaseBy: propsValue.adjustEstimate === 'manual' ? propsValue.increaseBy : undefined,
+ },
+ });
+ return { success: true, issue: issueIdOrKey, worklog_id: worklogId, deleted: true };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/download-attachment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/download-attachment.ts
new file mode 100644
index 00000000000..c3625aa641b
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/download-attachment.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+
+import { downloadAttachmentOutputSchema } from '../../output-schemas';
+export const downloadAttachmentAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'download_attachment',
+ classification: 'READ',
+ displayName: 'Download Attachment',
+ description: 'Downloads an attachment file and its metadata.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Download an attachment by attachment ID and return its file together with its name, MIME type, size, author and creation date. Attachment IDs are in the attachment field of Fetch Issue. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: downloadAttachmentOutputSchema,
+ props: {
+ attachmentId: Property.ShortText({
+ displayName: 'Attachment ID',
+ description: 'The numeric attachment ID, from the attachment field of Fetch Issue.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue, files }) {
+ const attachmentId = propsValue.attachmentId.trim();
+ const metadata = await jiraApiCall<AttachmentMetadata>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/attachment/${encodeURIComponent(attachmentId)}`,
+ });
+ const content = await httpClient.sendRequest<ArrayBuffer>({
+ method: HttpMethod.GET,
+ url: `${auth.props.instanceUrl}/rest/api/3/attachment/content/${encodeURIComponent(attachmentId)}`,
+ authentication: {
+ type: AuthenticationType.BASIC,
+ username: auth.props.email,
+ password: auth.props.apiToken,
+ },
+ responseType: 'arraybuffer',
+ followRedirects: true,
+ });
+ const file = await files.write({ fileName: metadata.filename, data: Buffer.from(content.body) });
+ return {
+ id: metadata.id,
+ filename: metadata.filename,
+ mime_type: metadata.mimeType ?? null,
+ size: metadata.size ?? null,
+ created: metadata.created ?? null,
+ author_account_id: metadata.author?.accountId ?? null,
+ author_display_name: metadata.author?.displayName ?? null,
+ file,
+ };
+ },
+});
+
+type AttachmentMetadata = {
+ id: string;
+ filename: string;
+ mimeType?: string;
+ size?: number;
+ created?: string;
+ author?: { accountId?: string; displayName?: string };
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/edit-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/edit-issue.ts
new file mode 100644
index 00000000000..c98c9b947ea
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/edit-issue.ts
@@ -0,0 +1,98 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { issueOutputSchema } from '../../output-schemas';
+export const editIssueAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'edit_issue',
+ classification: 'WRITE',
+ displayName: 'Edit Issue',
+ description: 'Updates only the given fields of an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Update selected fields of an existing issue: summary, description, assignee, priority, labels, parent, due date, issue type or any field by ID. Only the fields you supply change; everything else is left alone, and labels replace the current list. Status is not a field, use Transition Issue Status for that. Idempotent: applying the same values again changes nothing.',
+ idempotent: true,
+ },
+ outputSchema: issueOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ summary: Property.ShortText({
+ displayName: 'Summary',
+ required: false,
+ }),
+ description: jiraAiProps.optionalMarkdownText({ displayName: 'Description', description: 'New issue description, replacing the current one.' }),
+ assigneeAccountId: Property.ShortText({
+ displayName: 'Assignee Account ID',
+ description: 'Account ID of the new assignee. Resolve it with Find Users; to unassign use Assign Issue to User.',
+ required: false,
+ }),
+ priorityId: Property.ShortText({
+ displayName: 'Priority ID',
+ description: 'The priority ID. Find it with Get Priorities.',
+ required: false,
+ }),
+ labels: Property.Array({
+ displayName: 'Labels',
+ description: 'Labels that replace the current labels. Pass an empty list to remove all labels. Labels cannot contain spaces.',
+ required: false,
+ }),
+ parentKey: Property.ShortText({
+ displayName: 'Parent Issue Key',
+ description: 'Key of the new parent issue or epic.',
+ required: false,
+ }),
+ dueDate: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'Due date in YYYY-MM-DD format.',
+ required: false,
+ }),
+ issueTypeId: Property.ShortText({
+ displayName: 'Issue Type ID',
+ description: 'New issue type ID. Find it with Get Issue Types.',
+ required: false,
+ }),
+ fields: Property.Json({
+ displayName: 'Additional Fields',
+ description:
+ 'JSON object of other field IDs to values in Jira REST format, e.g. {"customfield_10016": 8}. Set a field to null to clear it. Editable field IDs come from Get Issue Edit Metadata.',
+ required: false,
+ }),
+ notifyUsers: Property.Checkbox({
+ displayName: 'Notify Watchers',
+ description: 'Send the usual update email to watchers. Turning it off needs admin rights.',
+ required: false,
+ defaultValue: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const labels = jiraAiHelpers.toStringList({ value: propsValue.labels });
+ const fields = {
+ ...jiraAiHelpers.buildIssueFields({
+ issueTypeId: propsValue.issueTypeId,
+ summary: propsValue.summary,
+ description: propsValue.description,
+ assigneeAccountId: propsValue.assigneeAccountId,
+ priorityId: propsValue.priorityId,
+ parentKey: propsValue.parentKey,
+ dueDate: propsValue.dueDate,
+ extraFields: jiraAiHelpers.toRecord({ value: propsValue.fields, label: 'Additional Fields' }),
+ }),
+ ...(Array.isArray(propsValue.labels) ? { labels } : {}),
+ };
+ if (Object.keys(fields).length === 0) {
+ throw new Error('Provide at least one field to update.');
+ }
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.PUT,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}`,
+ query: { returnIssue: 'true', notifyUsers: String(propsValue.notifyUsers !== false) },
+ body: { fields },
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/fetch-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/fetch-issue.ts
new file mode 100644
index 00000000000..3ed1093beff
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/fetch-issue.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { issueOutputSchema } from '../../output-schemas';
+export const fetchIssueAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'fetch_issue',
+ classification: 'READ',
+ displayName: 'Fetch Issue',
+ description: 'Gets an issue by key or ID.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Fetch one issue by key or ID with its fields (status, assignee, priority, description, attachments, issue links, custom fields), optionally limited to chosen fields and expanded with rendered HTML, field names, transitions or changelog. Use it when you know the issue; to find issues by criteria use Search Issues by JQL. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: issueOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ fields: Property.Array({
+ displayName: 'Fields',
+ description: 'Field IDs to return, e.g. summary, status, customfield_10016. Leave empty for all fields.',
+ required: false,
+ }),
+ expand: Property.StaticMultiSelectDropdown({
+ displayName: 'Expand',
+ required: false,
+ options: {
+ options: [
+ { label: 'Rendered Fields (HTML)', value: 'renderedFields' },
+ { label: 'Field Names', value: 'names' },
+ { label: 'Transitions', value: 'transitions' },
+ { label: 'Changelog', value: 'changelog' },
+ ],
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const fields = jiraAiHelpers.toStringList({ value: propsValue.fields });
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}`,
+ query: {
+ fields: fields.length > 0 ? fields : undefined,
+ expand: propsValue.expand,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/find-users.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/find-users.ts
new file mode 100644
index 00000000000..adc48043702
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/find-users.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { usersOutputSchema } from '../../output-schemas';
+export const findUsersAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'find_users',
+ classification: 'SEARCH',
+ displayName: 'Find Users',
+ description: 'Finds users by name or email.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Find users whose display name or email address matches a query, returning their account IDs, display names, active status and email when visible. The way to turn a person\'s name or email into the account ID that assign, watcher and notification actions need. Email matching depends on site privacy settings. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: usersOutputSchema,
+ props: {
+ query: Property.ShortText({
+ displayName: 'Query',
+ description: 'Text matched against display name and email address, e.g. jane or [email protected].',
+ required: true,
+ }),
+ includeInactive: Property.Checkbox({
+ displayName: 'Include Inactive Users',
+ required: false,
+ defaultValue: false,
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults({ max: 1000 }),
+ },
+ async run({ auth, propsValue }) {
+ const users = await jiraApiCall<JiraRecord[]>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/user/search',
+ query: { query: propsValue.query.trim(), startAt: propsValue.startAt, maxResults: propsValue.maxResults },
+ });
+ const items = propsValue.includeInactive ? users : users.filter((user) => user['active'] !== false);
+ return jiraAiHelpers.toList({ items });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-comment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-comment.ts
new file mode 100644
index 00000000000..2cdfff9eaa8
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-comment.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { commentOutputSchema } from '../../output-schemas';
+export const getCommentAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_comment',
+ classification: 'READ',
+ displayName: 'Get Comment',
+ description: 'Gets a single comment on an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Fetch one comment on an issue by its comment ID, including author, timestamps, visibility and the body as Atlassian Document Format plus rendered HTML. Use List Comments to discover comment IDs. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: commentOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'The numeric comment ID. Find it with List Comments.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/comment/${encodeURIComponent(propsValue.commentId.trim())}`,
+ query: { expand: 'renderedBody' },
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-current-user.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-current-user.ts
new file mode 100644
index 00000000000..440c2c8ab1d
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-current-user.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord } from '../../common/ai-helpers';
+
+import { currentUserOutputSchema } from '../../output-schemas';
+export const getCurrentUserAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_current_user',
+ classification: 'READ',
+ displayName: 'Get Current User',
+ description: 'Gets the user the connection is authenticated as.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Return the Jira user the connection is authenticated as, including account ID, display name, email (when visible), time zone and groups. Use it to get your own account ID for "assigned to me" requests or for Assign Issue to User. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: currentUserOutputSchema,
+ props: {},
+ async run({ auth }) {
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/myself',
+ query: { expand: 'groups' },
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-favorite-filters.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-favorite-filters.ts
new file mode 100644
index 00000000000..73086cef595
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-favorite-filters.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { filterListOutputSchema } from '../../output-schemas';
+export const getFavoriteFiltersAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_favorite_filters',
+ classification: 'SEARCH',
+ displayName: 'Get Favorite Filters',
+ description: 'Lists the filters the user has starred.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the saved filters the connected user has starred as favourites, with each filter ID, name and JQL. A quick way to find the searches the user relies on; use Search Filters to search all visible filters. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: filterListOutputSchema,
+ props: {},
+ async run({ auth }) {
+ const filters = await jiraApiCall<JiraRecord[]>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/filter/favourite',
+ });
+ return jiraAiHelpers.toList({ items: filters });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-fields.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-fields.ts
new file mode 100644
index 00000000000..e980ecf3df1
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-fields.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { fieldsListOutputSchema } from '../../output-schemas';
+export const getFieldsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_fields',
+ classification: 'SEARCH',
+ displayName: 'Get Fields',
+ description: 'Lists all system and custom issue fields.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List every system and custom issue field with its ID (e.g. customfield_10016), name and schema type. Use it to translate a field name into the ID that Create Issue, Edit Issue and JQL need; for the fields allowed on one project and issue type use Get Issue Type Create Fields instead. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: fieldsListOutputSchema,
+ props: {
+ nameContains: Property.ShortText({
+ displayName: 'Name Contains',
+ description: 'Only return fields whose name contains this text (case-insensitive).',
+ required: false,
+ }),
+ customOnly: Property.Checkbox({
+ displayName: 'Custom Fields Only',
+ description: 'Only return custom fields.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const fields = await jiraApiCall<JiraRecord[]>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/field',
+ });
+ const needle = propsValue.nameContains?.trim().toLowerCase() ?? '';
+ const items = fields.filter(
+ (field) =>
+ (!propsValue.customOnly || field['custom'] === true) &&
+ (needle.length === 0 || String(field['name'] ?? '').toLowerCase().includes(needle)),
+ );
+ return jiraAiHelpers.toList({ items });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-filter.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-filter.ts
new file mode 100644
index 00000000000..568ed1ea03f
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-filter.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord } from '../../common/ai-helpers';
+
+import { filterOutputSchema } from '../../output-schemas';
+export const getFilterAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_filter',
+ classification: 'READ',
+ displayName: 'Get Filter',
+ description: 'Gets a saved filter, including its JQL.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Fetch one saved filter by ID, including its name, owner, JQL, sharing permissions and view URL. Use it to reuse the filter JQL in Search Issues by JQL or Count Issues. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: filterOutputSchema,
+ props: {
+ filterId: Property.ShortText({
+ displayName: 'Filter ID',
+ description: 'The numeric filter ID. Find it with Search Filters or Get Favorite Filters.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/filter/${encodeURIComponent(propsValue.filterId.trim())}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-edit-metadata.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-edit-metadata.ts
new file mode 100644
index 00000000000..687c2b78428
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-edit-metadata.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { issueEditMetadataOutputSchema } from '../../output-schemas';
+export const getIssueEditMetadataAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_issue_edit_metadata',
+ classification: 'READ',
+ displayName: 'Get Issue Edit Metadata',
+ description: 'Lists the fields that can be edited on an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the fields that can be edited on one existing issue, keyed by field ID, with each field schema, allowed operations and allowed values. Call it before Edit Issue to learn which fields and option IDs the issue accepts. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: issueEditMetadataOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ },
+ async run({ auth, propsValue }) {
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/editmeta`,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-link-types.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-link-types.ts
new file mode 100644
index 00000000000..ad84d65166e
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-link-types.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { issueLinkTypesOutputSchema } from '../../output-schemas';
+export const getIssueLinkTypesAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_issue_link_types',
+ classification: 'SEARCH',
+ displayName: 'Get Issue Link Types',
+ description: 'Lists the issue link types configured in Jira.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the issue link types configured on the site (e.g. Blocks, Relates, Duplicates), each with its name and inward/outward wording. Call it before Create Issue Link to pick a valid link type name and the correct direction. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: issueLinkTypesOutputSchema,
+ props: {},
+ async run({ auth }) {
+ const response = await jiraApiCall<{ issueLinkTypes?: JiraRecord[] }>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/issueLinkType',
+ });
+ return jiraAiHelpers.toList({ items: response.issueLinkTypes ?? [] });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-resolutions.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-resolutions.ts
new file mode 100644
index 00000000000..b7a3d7f3bdd
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-resolutions.ts
@@ -0,0 +1,41 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { resolutionsOutputSchema } from '../../output-schemas';
+export const getIssueResolutionsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_issue_resolutions',
+ classification: 'SEARCH',
+ displayName: 'Get Issue Resolutions',
+ description: 'Lists the issue resolutions configured in Jira.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the issue resolutions configured on the site (e.g. Done, Won\'t Do, Duplicate) with their IDs. Use it to find the resolution ID a transition screen requires when closing an issue with Transition Issue Status. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: resolutionsOutputSchema,
+ props: {
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<JiraPageBean<JiraRecord>>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/resolution/search',
+ query: { startAt: propsValue.startAt, maxResults: propsValue.maxResults },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-transitions.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-transitions.ts
new file mode 100644
index 00000000000..20afaa2a0da
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-transitions.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { issueTransitionsOutputSchema } from '../../output-schemas';
+export const getIssueTransitionsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_issue_transitions',
+ classification: 'READ',
+ displayName: 'Get Issue Transitions',
+ description: 'Lists the workflow transitions available on an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the workflow transitions the connected user can perform on an issue from its current status, each with its numeric ID, name and target status. Call it before Transition Issue Status, which needs the numeric transition ID rather than a status name. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: issueTransitionsOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ includeFields: Property.Checkbox({
+ displayName: 'Include Transition Screen Fields',
+ description: 'Also return the fields shown on each transition screen, such as a required resolution.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<{ transitions?: JiraRecord[] }>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/transitions`,
+ query: { expand: propsValue.includeFields ? 'transitions.fields' : undefined },
+ });
+ return jiraAiHelpers.toList({ items: response.transitions ?? [] });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-type-create-fields.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-type-create-fields.ts
new file mode 100644
index 00000000000..5ec757d20d1
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-type-create-fields.ts
@@ -0,0 +1,53 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { issueTypeCreateFieldsOutputSchema } from '../../output-schemas';
+export const getIssueTypeCreateFieldsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_issue_type_create_fields',
+ classification: 'READ',
+ displayName: 'Get Issue Type Create Fields',
+ description: 'Lists the fields available when creating an issue of a given type in a project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the fields that can be set when creating an issue of one issue type in one project, with whether each is required, its schema and its allowed values. Call it before Create Issue with Fields to learn which custom fields are mandatory and what IDs they accept. Issue type IDs come from Get Issue Types. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: issueTypeCreateFieldsOutputSchema,
+ props: {
+ projectIdOrKey: jiraAiProps.projectIdOrKey(),
+ issueTypeId: Property.ShortText({
+ displayName: 'Issue Type ID',
+ description: 'The numeric issue type ID. Find it with Get Issue Types.',
+ required: true,
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults({ defaultValue: 100, max: 200 }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<CreateMetaFieldsPage>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/createmeta/${encodeURIComponent(propsValue.projectIdOrKey.trim())}/issuetypes/${encodeURIComponent(propsValue.issueTypeId.trim())}`,
+ query: { startAt: propsValue.startAt, maxResults: propsValue.maxResults },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.fields ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ });
+ },
+});
+
+type CreateMetaFieldsPage = {
+ fields?: JiraRecord[];
+ startAt?: number;
+ maxResults?: number;
+ total?: number;
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-types.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-types.ts
new file mode 100644
index 00000000000..97a5492e3f3
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-types.ts
@@ -0,0 +1,48 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { JiraAuth, jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { issueTypesOutputSchema } from '../../output-schemas';
+export const getIssueTypesAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_issue_types',
+ classification: 'SEARCH',
+ displayName: 'Get Issue Types',
+ description: 'Lists the issue types available in a project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the issue types (Task, Bug, Story, Epic, Subtask and custom ones) available in one project, with their numeric IDs and whether each is a subtask type. Call it to get the issue type ID that Create Issue with Fields and Get Issue Type Create Fields require. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: issueTypesOutputSchema,
+ props: {
+ projectIdOrKey: jiraAiProps.projectIdOrKey(),
+ },
+ async run({ auth, propsValue }) {
+ const projectId = await resolveProjectId({ auth, projectIdOrKey: propsValue.projectIdOrKey });
+ const issueTypes = await jiraApiCall<JiraRecord[]>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/issuetype/project',
+ query: { projectId },
+ });
+ return { project_id: projectId, ...jiraAiHelpers.toList({ items: issueTypes }) };
+ },
+});
+
+async function resolveProjectId({ auth, projectIdOrKey }: { auth: JiraAuth; projectIdOrKey: string }): Promise<string> {
+ const trimmed = projectIdOrKey.trim();
+ if (/^\d+$/.test(trimmed)) {
+ return trimmed;
+ }
+ const project = await jiraApiCall<{ id: string }>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/project/${encodeURIComponent(trimmed)}`,
+ });
+ return project.id;
+}
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-votes.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-votes.ts
new file mode 100644
index 00000000000..394d5828a59
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-votes.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { issueVotesOutputSchema } from '../../output-schemas';
+export const getIssueVotesAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_issue_votes',
+ classification: 'READ',
+ displayName: 'Get Issue Votes',
+ description: 'Gets the vote count and voters of an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Return the number of votes on an issue, whether the connected user has voted, and the voters when the user may see them. Voting must be enabled on the site. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: issueVotesOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ },
+ async run({ auth, propsValue }) {
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/votes`,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-watchers.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-watchers.ts
new file mode 100644
index 00000000000..46b4b375371
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-issue-watchers.ts
@@ -0,0 +1,43 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { issueWatchersOutputSchema } from '../../output-schemas';
+export const getIssueWatchersAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_issue_watchers',
+ classification: 'SEARCH',
+ displayName: 'Get Issue Watchers',
+ description: 'Lists the users watching an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the users watching an issue, with their account IDs and whether the connected user is one of them. Use it before Add Watcher or Remove Watcher to check the current list. Watcher details may be hidden by site privacy settings. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: issueWatchersOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<WatchersResponse>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/watchers`,
+ });
+ return {
+ ...jiraAiHelpers.toList({ items: response.watchers ?? [] }),
+ watch_count: response.watchCount ?? null,
+ is_watching: response.isWatching ?? null,
+ };
+ },
+});
+
+type WatchersResponse = {
+ watchers?: JiraRecord[];
+ watchCount?: number;
+ isWatching?: boolean;
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-jql-field-suggestions.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-jql-field-suggestions.ts
new file mode 100644
index 00000000000..4877cb1d948
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-jql-field-suggestions.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { jqlSuggestionsOutputSchema } from '../../output-schemas';
+export const getJqlFieldSuggestionsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_jql_field_suggestions',
+ classification: 'SEARCH',
+ displayName: 'Get JQL Field Suggestions',
+ description: 'Suggests valid values for a JQL field.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Suggest valid JQL values for one field, e.g. the exact names of statuses, sprints, labels or custom field options, optionally matching partially typed text. Use it to write exact values in JQL for Search Issues by JQL; field names come from Get JQL Reference Data. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: jqlSuggestionsOutputSchema,
+ props: {
+ fieldName: Property.ShortText({
+ displayName: 'Field Name',
+ description: 'The JQL field name, e.g. status, labels, sprint, or cf[10016].',
+ required: true,
+ }),
+ fieldValue: Property.ShortText({
+ displayName: 'Partial Value',
+ description: 'Partially typed value to match.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<{ results?: JiraRecord[] }>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/jql/autocompletedata/suggestions',
+ query: { fieldName: propsValue.fieldName.trim(), fieldValue: propsValue.fieldValue },
+ });
+ return jiraAiHelpers.toList({ items: response.results ?? [] });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-jql-reference-data.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-jql-reference-data.ts
new file mode 100644
index 00000000000..41c6cb5c9a9
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-jql-reference-data.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord } from '../../common/ai-helpers';
+
+import { jqlReferenceDataOutputSchema } from '../../output-schemas';
+export const getJqlReferenceDataAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_jql_reference_data',
+ classification: 'READ',
+ displayName: 'Get JQL Reference Data',
+ description: 'Lists the fields, functions and reserved words usable in JQL.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Return the field names (with their operators and types), functions and reserved words usable in JQL on this site, optionally filtered by field name. Use it to write a valid JQL clause for a custom field, then Get JQL Field Suggestions for its values. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: jqlReferenceDataOutputSchema,
+ props: {
+ fieldNameContains: Property.ShortText({
+ displayName: 'Field Name Contains',
+ description: 'Only return fields whose name or display name contains this text (case-insensitive).',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<JqlReferenceData>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/jql/autocompletedata',
+ });
+ const needle = propsValue.fieldNameContains?.trim().toLowerCase() ?? '';
+ const fields = (response.visibleFieldNames ?? []).filter(
+ (field) =>
+ needle.length === 0 ||
+ String(field['value'] ?? '').toLowerCase().includes(needle) ||
+ String(field['displayName'] ?? '').toLowerCase().includes(needle),
+ );
+ return {
+ fields,
+ field_count: fields.length,
+ functions: response.visibleFunctionNames ?? [],
+ reserved_words: response.jqlReservedWords ?? [],
+ };
+ },
+});
+
+type JqlReferenceData = {
+ visibleFieldNames?: JiraRecord[];
+ visibleFunctionNames?: JiraRecord[];
+ jqlReservedWords?: string[];
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-my-permissions.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-my-permissions.ts
new file mode 100644
index 00000000000..4aba5ca6fc1
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-my-permissions.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { myPermissionsOutputSchema } from '../../output-schemas';
+export const getMyPermissionsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_my_permissions',
+ classification: 'READ',
+ displayName: 'Get My Permissions',
+ description: 'Checks which permissions the user has, globally or in a project or issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Check whether the connected user holds specific permissions, globally or within one project or issue, returning havePermission for each key. Use it before a write to explain a likely permission failure; to list every project where a permission holds use Get Permitted Projects. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: myPermissionsOutputSchema,
+ props: {
+ permissions: Property.Array({
+ displayName: 'Permission Keys',
+ description:
+ 'Permission keys to check, e.g. BROWSE_PROJECTS, CREATE_ISSUES, EDIT_ISSUES, TRANSITION_ISSUES, ASSIGN_ISSUES, ADD_COMMENTS, DELETE_ISSUES, WORK_ON_ISSUES, ADMINISTER_PROJECTS.',
+ required: true,
+ }),
+ projectKey: Property.ShortText({
+ displayName: 'Project Key',
+ description: 'Check the permissions within this project.',
+ required: false,
+ }),
+ issueKey: Property.ShortText({
+ displayName: 'Issue Key',
+ description: 'Check the permissions on this issue.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const permissions = jiraAiHelpers.toStringList({ value: propsValue.permissions });
+ if (permissions.length === 0) {
+ throw new Error('Provide at least one permission key.');
+ }
+ const response = await jiraApiCall<{ permissions?: Record<string, JiraRecord> }>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/mypermissions',
+ query: { permissions, projectKey: propsValue.projectKey, issueKey: propsValue.issueKey },
+ });
+ return jiraAiHelpers.toList({ items: Object.values(response.permissions ?? {}) });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-permitted-projects.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-permitted-projects.ts
new file mode 100644
index 00000000000..2e0bbd569ce
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-permitted-projects.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { permittedProjectsOutputSchema } from '../../output-schemas';
+export const getPermittedProjectsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_permitted_projects',
+ classification: 'SEARCH',
+ displayName: 'Get Permitted Projects',
+ description: 'Lists the projects where the user has all given permissions.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the projects in which the connected user holds every one of the given project permissions, e.g. the projects where they can create issues. Returns project IDs and keys only; use Get Project for details. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: permittedProjectsOutputSchema,
+ props: {
+ permissions: Property.Array({
+ displayName: 'Permission Keys',
+ description: 'Project permission keys that must all be held, e.g. CREATE_ISSUES, EDIT_ISSUES, TRANSITION_ISSUES.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const permissions = jiraAiHelpers.toStringList({ value: propsValue.permissions });
+ if (permissions.length === 0) {
+ throw new Error('Provide at least one permission key.');
+ }
+ const response = await jiraApiCall<{ projects?: JiraRecord[] }>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: '/permissions/project',
+ body: { permissions },
+ });
+ return jiraAiHelpers.toList({ items: response.projects ?? [] });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-priorities.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-priorities.ts
new file mode 100644
index 00000000000..b2db533d8c4
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-priorities.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { prioritiesOutputSchema } from '../../output-schemas';
+export const getPrioritiesAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_priorities',
+ classification: 'SEARCH',
+ displayName: 'Get Priorities',
+ description: 'Lists the issue priorities.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the issue priorities (e.g. Highest, High, Medium, Low) with their IDs, optionally limited to those available in one project. Use it to get the priority ID that Create Issue with Fields and Edit Issue expect. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: prioritiesOutputSchema,
+ props: {
+ projectId: Property.ShortText({
+ displayName: 'Project ID',
+ description: 'Only return priorities available in this project. Must be the numeric project ID (see Get Project); leave empty for all.',
+ required: false,
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<JiraPageBean<JiraRecord>>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/priority/search',
+ query: { projectId: propsValue.projectId, startAt: propsValue.startAt, maxResults: propsValue.maxResults },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project-components.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project-components.ts
new file mode 100644
index 00000000000..2309c66f758
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project-components.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { componentsOutputSchema } from '../../output-schemas';
+export const getProjectComponentsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_project_components',
+ classification: 'SEARCH',
+ displayName: 'Get Project Components',
+ description: 'Lists the components of a project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the components of one project, optionally filtered by name or description text, with their IDs, leads and issue counts. Use it to find component IDs for the components field of Create Issue with Fields or Edit Issue. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: componentsOutputSchema,
+ props: {
+ projectIdOrKey: jiraAiProps.projectIdOrKey(),
+ query: Property.ShortText({
+ displayName: 'Query',
+ description: 'Only return components whose name or description contains this text.',
+ required: false,
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<JiraPageBean<JiraRecord>>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/project/${encodeURIComponent(propsValue.projectIdOrKey.trim())}/component`,
+ query: { query: propsValue.query, startAt: propsValue.startAt, maxResults: propsValue.maxResults },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project-versions.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project-versions.ts
new file mode 100644
index 00000000000..dba3d97aafc
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project-versions.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { versionsOutputSchema } from '../../output-schemas';
+export const getProjectVersionsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_project_versions',
+ classification: 'SEARCH',
+ displayName: 'Get Project Versions',
+ description: 'Lists the versions (releases) of a project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the versions (releases) of one project, optionally filtered by name and by released, unreleased or archived status, with their IDs and release dates. Use it to find the version IDs that the fixVersions field of Create Issue with Fields or Edit Issue expects. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: versionsOutputSchema,
+ props: {
+ projectIdOrKey: jiraAiProps.projectIdOrKey(),
+ query: Property.ShortText({
+ displayName: 'Query',
+ description: 'Only return versions whose name or description contains this text.',
+ required: false,
+ }),
+ status: Property.StaticMultiSelectDropdown({
+ displayName: 'Status',
+ description: 'Only return versions with these statuses.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Released', value: 'released' },
+ { label: 'Unreleased', value: 'unreleased' },
+ { label: 'Archived', value: 'archived' },
+ ],
+ },
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults(),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<JiraPageBean<JiraRecord>>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/project/${encodeURIComponent(propsValue.projectIdOrKey.trim())}/version`,
+ query: {
+ query: propsValue.query,
+ status: propsValue.status,
+ startAt: propsValue.startAt,
+ maxResults: propsValue.maxResults,
+ },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project.ts
new file mode 100644
index 00000000000..8b7cf28376a
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-project.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { projectOutputSchema } from '../../output-schemas';
+export const getProjectAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_project',
+ classification: 'READ',
+ displayName: 'Get Project',
+ description: 'Gets the details of a project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Fetch one project by key or ID, including its numeric ID, name, description, lead, project type, issue types, components and versions. Use List Projects to find a project by name. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: projectOutputSchema,
+ props: {
+ projectIdOrKey: jiraAiProps.projectIdOrKey(),
+ },
+ async run({ auth, propsValue }) {
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/project/${encodeURIComponent(propsValue.projectIdOrKey.trim())}`,
+ query: { expand: 'description,lead,issueTypes,url' },
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-recent-projects.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-recent-projects.ts
new file mode 100644
index 00000000000..5444f616ca3
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-recent-projects.ts
@@ -0,0 +1,31 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { projectListOutputSchema } from '../../output-schemas';
+export const getRecentProjectsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_recent_projects',
+ classification: 'SEARCH',
+ displayName: 'Get Recent Projects',
+ description: 'Lists the projects the user viewed most recently.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List up to 20 projects the connected user viewed most recently, newest first. A quick way to guess which project the user means; use List Projects to search all projects. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: projectListOutputSchema,
+ props: {},
+ async run({ auth }) {
+ const projects = await jiraApiCall<JiraRecord[]>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/project/recent',
+ query: { expand: 'description,lead' },
+ });
+ return jiraAiHelpers.toList({ items: projects });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-remote-issue-links.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-remote-issue-links.ts
new file mode 100644
index 00000000000..bb330608a50
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-remote-issue-links.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { remoteIssueLinksOutputSchema } from '../../output-schemas';
+export const getRemoteIssueLinksAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_remote_issue_links',
+ classification: 'SEARCH',
+ displayName: 'Get Remote Issue Links',
+ description: 'Lists the links from an issue to external resources.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the remote links on an issue that point outside Jira, such as Confluence pages, pull requests or web URLs, with each title and URL. Links between two Jira issues are not included; read those from the issuelinks field of Fetch Issue. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: remoteIssueLinksOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ },
+ async run({ auth, propsValue }) {
+ const links = await jiraApiCall<JiraRecord[]>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/remotelink`,
+ });
+ return jiraAiHelpers.toList({ items: links });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-sprint.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-sprint.ts
new file mode 100644
index 00000000000..b0a974e6f83
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-sprint.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { JiraRecord } from '../../common/ai-helpers';
+
+import { sprintOutputSchema } from '../../output-schemas';
+export const getSprintAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_sprint',
+ classification: 'READ',
+ displayName: 'Get Sprint',
+ description: 'Gets the details of a sprint.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Fetch one sprint by its numeric ID, including name, state, start, end and completion dates, goal and board. Use List Sprints to find sprint IDs. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: sprintOutputSchema,
+ props: {
+ sprintId: Property.Number({
+ displayName: 'Sprint ID',
+ description: 'The numeric sprint ID. Find it with List Sprints.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await httpClient.sendRequest<JiraRecord>({
+ method: HttpMethod.GET,
+ url: `${auth.props.instanceUrl}/rest/agile/1.0/sprint/${propsValue.sprintId}`,
+ authentication: {
+ type: AuthenticationType.BASIC,
+ username: auth.props.email,
+ password: auth.props.apiToken,
+ },
+ });
+ return response.body;
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-statuses.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-statuses.ts
new file mode 100644
index 00000000000..21d80f0718d
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-statuses.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { statusesOutputSchema } from '../../output-schemas';
+export const getStatusesAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_statuses',
+ classification: 'SEARCH',
+ displayName: 'Get Statuses',
+ description: 'Lists the issue statuses used in active workflows.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the issue statuses used in active workflows, with their IDs, names and status category (To Do, In Progress, Done). Use it to write valid status names in JQL; to move an issue to a status use Get Issue Transitions, since statuses cannot be set directly. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: statusesOutputSchema,
+ props: {
+ nameContains: Property.ShortText({
+ displayName: 'Name Contains',
+ description: 'Only return statuses whose name contains this text (case-insensitive).',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const statuses = await jiraApiCall<JiraRecord[]>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/status',
+ });
+ const needle = propsValue.nameContains?.trim().toLowerCase() ?? '';
+ const items = needle.length === 0 ? statuses : statuses.filter((status) => String(status['name'] ?? '').toLowerCase().includes(needle));
+ return jiraAiHelpers.toList({ items });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-user-groups.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-user-groups.ts
new file mode 100644
index 00000000000..81ae671dc9d
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-user-groups.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { userGroupsOutputSchema } from '../../output-schemas';
+export const getUserGroupsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_user_groups',
+ classification: 'SEARCH',
+ displayName: 'Get User Groups',
+ description: 'Lists the groups a user belongs to.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the groups one user belongs to, with each group name and group ID. Use it to check group membership or to get group IDs for Send Issue Notification. Needs the Browse users and groups permission. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: userGroupsOutputSchema,
+ props: {
+ accountId: jiraAiProps.accountId(),
+ },
+ async run({ auth, propsValue }) {
+ const groups = await jiraApiCall<JiraRecord[]>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/user/groups',
+ query: { accountId: propsValue.accountId.trim() },
+ });
+ return jiraAiHelpers.toList({ items: groups });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-worklogs.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-worklogs.ts
new file mode 100644
index 00000000000..75cc1b65c58
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/get-worklogs.ts
@@ -0,0 +1,75 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import dayjs from 'dayjs';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { worklogPageOutputSchema } from '../../output-schemas';
+export const getWorklogsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'get_worklogs',
+ classification: 'SEARCH',
+ displayName: 'Get Worklogs',
+ description: 'Lists the worklogs of an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the worklog entries of an issue, oldest first, with author, time spent in seconds, start time and comment, optionally limited to work started within a date range. Use it for time reports or to find a worklog ID for Delete Worklog. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: worklogPageOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ startedAfter: Property.DateTime({
+ displayName: 'Started After',
+ description: 'Only return worklogs started on or after this time (ISO 8601).',
+ required: false,
+ }),
+ startedBefore: Property.DateTime({
+ displayName: 'Started Before',
+ description: 'Only return worklogs started on or before this time (ISO 8601).',
+ required: false,
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults({ max: 5000 }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<WorklogPage>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/worklog`,
+ query: {
+ startAt: propsValue.startAt,
+ maxResults: propsValue.maxResults,
+ startedAfter: toEpochMillis({ value: propsValue.startedAfter, label: 'Started After' }),
+ startedBefore: toEpochMillis({ value: propsValue.startedBefore, label: 'Started Before' }),
+ },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.worklogs ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ });
+ },
+});
+
+function toEpochMillis({ value, label }: { value: string | undefined; label: string }): number | undefined {
+ if (!jiraAiHelpers.isProvided(value)) {
+ return undefined;
+ }
+ const parsed = dayjs(value);
+ if (!parsed.isValid()) {
+ throw new Error(`${label} must be a valid ISO 8601 date-time.`);
+ }
+ return parsed.valueOf();
+}
+
+type WorklogPage = {
+ worklogs?: JiraRecord[];
+ startAt?: number;
+ maxResults?: number;
+ total?: number;
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-boards.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-boards.ts
new file mode 100644
index 00000000000..26f74fd0c8b
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-boards.ts
@@ -0,0 +1,70 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { boardsOutputSchema } from '../../output-schemas';
+export const listBoardsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'list_boards',
+ classification: 'SEARCH',
+ displayName: 'List Boards',
+ description: 'Lists the Scrum and Kanban boards visible to the user.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the Jira Software boards visible to the connected user, optionally filtered by name, type (scrum or kanban) and project, with their numeric board IDs. Board IDs are required by List Sprints and Create Sprint. Requires Jira Software on the site. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: boardsOutputSchema,
+ props: {
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Only return boards whose name contains this text.',
+ required: false,
+ }),
+ type: Property.StaticDropdown({
+ displayName: 'Board Type',
+ required: false,
+ options: {
+ options: [
+ { label: 'Scrum', value: 'scrum' },
+ { label: 'Kanban', value: 'kanban' },
+ ],
+ },
+ }),
+ projectKeyOrId: Property.ShortText({
+ displayName: 'Project ID or Key',
+ description: 'Only return boards that include this project.',
+ required: false,
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults(),
+ },
+ async run({ auth, propsValue }) {
+ const { body: response } = await httpClient.sendRequest<JiraPageBean<JiraRecord>>({
+ method: HttpMethod.GET,
+ url: `${auth.props.instanceUrl}/rest/agile/1.0/board`,
+ queryParams: {
+ startAt: String(propsValue.startAt ?? 0),
+ maxResults: String(propsValue.maxResults ?? 50),
+ ...(jiraAiHelpers.isProvided(propsValue.name) ? { name: propsValue.name } : {}),
+ ...(jiraAiHelpers.isProvided(propsValue.type) ? { type: propsValue.type } : {}),
+ ...(jiraAiHelpers.isProvided(propsValue.projectKeyOrId) ? { projectKeyOrId: propsValue.projectKeyOrId.trim() } : {}),
+ },
+ authentication: {
+ type: AuthenticationType.BASIC,
+ username: auth.props.email,
+ password: auth.props.apiToken,
+ },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-comments.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-comments.ts
new file mode 100644
index 00000000000..82ef1fc10b2
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-comments.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { commentPageOutputSchema } from '../../output-schemas';
+export const listCommentsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'list_comments',
+ classification: 'SEARCH',
+ displayName: 'List Comments',
+ description: 'Lists the comments on an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the comments on an issue, oldest or newest first, with each comment ID, author, timestamps and body as Atlassian Document Format plus rendered HTML. Use it to read a discussion or to find comment IDs for Update Comment and Delete Comment. Paginated with Start At. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: commentPageOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ orderBy: Property.StaticDropdown({
+ displayName: 'Order',
+ required: false,
+ defaultValue: 'created',
+ options: {
+ options: [
+ { label: 'Oldest first', value: 'created' },
+ { label: 'Newest first', value: '-created' },
+ ],
+ },
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults({ max: 5000 }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<CommentPage>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/comment`,
+ query: {
+ orderBy: propsValue.orderBy,
+ startAt: propsValue.startAt,
+ maxResults: propsValue.maxResults,
+ expand: 'renderedBody',
+ },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.comments ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ });
+ },
+});
+
+type CommentPage = {
+ comments?: JiraRecord[];
+ startAt?: number;
+ maxResults?: number;
+ total?: number;
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-projects.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-projects.ts
new file mode 100644
index 00000000000..7b57e7a04e2
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-projects.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { projectPageOutputSchema } from '../../output-schemas';
+export const listProjectsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'list_projects',
+ classification: 'SEARCH',
+ displayName: 'List Projects',
+ description: 'Lists or searches the projects visible to the user.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the projects visible to the connected user, optionally filtered by text in the project name or key and by project type, with each project ID, key, name and type. The starting point for resolving a project name to the key or ID that other actions need. Paginated with Start At. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: projectPageOutputSchema,
+ props: {
+ query: Property.ShortText({
+ displayName: 'Query',
+ description: 'Only return projects whose name or key contains this text (case-insensitive).',
+ required: false,
+ }),
+ typeKey: Property.StaticDropdown({
+ displayName: 'Project Type',
+ required: false,
+ options: {
+ options: [
+ { label: 'Software', value: 'software' },
+ { label: 'Business', value: 'business' },
+ { label: 'Service Management', value: 'service_desk' },
+ { label: 'Product Discovery', value: 'product_discovery' },
+ ],
+ },
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults({ max: 100 }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<JiraPageBean<JiraRecord>>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/project/search',
+ query: {
+ query: propsValue.query,
+ typeKey: propsValue.typeKey,
+ startAt: propsValue.startAt,
+ maxResults: propsValue.maxResults,
+ expand: 'description,lead',
+ },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-sprints.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-sprints.ts
new file mode 100644
index 00000000000..522b85446f1
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/list-sprints.ts
@@ -0,0 +1,65 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { sprintsOutputSchema } from '../../output-schemas';
+export const listSprintsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'list_sprints',
+ classification: 'SEARCH',
+ displayName: 'List Sprints',
+ description: 'Lists the sprints of a Scrum board.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'List the sprints of one Scrum board, optionally filtered by state (future, active, closed), with their numeric IDs, dates and goals. Use it to find the sprint ID for Move Issues to Sprint; Kanban boards have no sprints and return an error. Board IDs come from List Boards. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: sprintsOutputSchema,
+ props: {
+ boardId: Property.Number({
+ displayName: 'Board ID',
+ description: 'The numeric board ID. Find it with List Boards.',
+ required: true,
+ }),
+ state: Property.StaticMultiSelectDropdown({
+ displayName: 'State',
+ required: false,
+ options: {
+ options: [
+ { label: 'Future', value: 'future' },
+ { label: 'Active', value: 'active' },
+ { label: 'Closed', value: 'closed' },
+ ],
+ },
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults(),
+ },
+ async run({ auth, propsValue }) {
+ const state = propsValue.state ?? [];
+ const { body: response } = await httpClient.sendRequest<JiraPageBean<JiraRecord>>({
+ method: HttpMethod.GET,
+ url: `${auth.props.instanceUrl}/rest/agile/1.0/board/${propsValue.boardId}/sprint`,
+ queryParams: {
+ startAt: String(propsValue.startAt ?? 0),
+ maxResults: String(propsValue.maxResults ?? 50),
+ ...(state.length > 0 ? { state: state.join(',') } : {}),
+ },
+ authentication: {
+ type: AuthenticationType.BASIC,
+ username: auth.props.email,
+ password: auth.props.apiToken,
+ },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/move-issues-to-sprint.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/move-issues-to-sprint.ts
new file mode 100644
index 00000000000..7de9284ed11
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/move-issues-to-sprint.ts
@@ -0,0 +1,51 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraAiHelpers } from '../../common/ai-helpers';
+
+import { moveIssuesToSprintOutputSchema } from '../../output-schemas';
+export const moveIssuesToSprintAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'move_issues_to_sprint',
+ classification: 'WRITE',
+ displayName: 'Move Issues to Sprint',
+ description: 'Moves up to 50 issues into a sprint.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Move up to 50 issues into an open (future or active) sprint, taking them out of the backlog or any other sprint. Closed sprints are rejected. Sprint IDs come from List Sprints. Idempotent: moving issues already in the sprint leaves them there.',
+ idempotent: true,
+ },
+ outputSchema: moveIssuesToSprintOutputSchema,
+ props: {
+ sprintId: Property.Number({
+ displayName: 'Sprint ID',
+ description: 'The numeric ID of a future or active sprint. Find it with List Sprints.',
+ required: true,
+ }),
+ issues: Property.Array({
+ displayName: 'Issue Keys',
+ description: 'Up to 50 issue keys (e.g. PROJ-123) or numeric issue IDs.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const issues = jiraAiHelpers.toStringList({ value: propsValue.issues });
+ if (issues.length === 0 || issues.length > MAX_ISSUES) {
+ throw new Error(`Issue Keys must contain between 1 and ${MAX_ISSUES} items.`);
+ }
+ await httpClient.sendRequest({
+ method: HttpMethod.POST,
+ url: `${auth.props.instanceUrl}/rest/agile/1.0/sprint/${propsValue.sprintId}/issue`,
+ authentication: {
+ type: AuthenticationType.BASIC,
+ username: auth.props.email,
+ password: auth.props.apiToken,
+ },
+ body: { issues },
+ });
+ return { success: true, sprint_id: propsValue.sprintId, issues, count: issues.length };
+ },
+});
+
+const MAX_ISSUES = 50;
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/parse-jql.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/parse-jql.ts
new file mode 100644
index 00000000000..93ab9070abb
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/parse-jql.ts
@@ -0,0 +1,55 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { parseJqlOutputSchema } from '../../output-schemas';
+export const parseJqlAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'parse_jql',
+ classification: 'READ',
+ displayName: 'Parse JQL',
+ description: 'Validates JQL queries and returns their structure.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Validate one or more JQL queries and return, for each, its parsed structure plus any errors or warnings such as unknown fields or values. Use it to check a generated query before Search Issues by JQL or Count Issues. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: parseJqlOutputSchema,
+ props: {
+ queries: Property.Array({
+ displayName: 'Queries',
+ description: 'JQL queries to parse.',
+ required: true,
+ }),
+ validation: Property.StaticDropdown({
+ displayName: 'Validation',
+ description: 'Strict reports unknown fields and values as errors, warn reports them as warnings, none only checks syntax.',
+ required: false,
+ defaultValue: 'strict',
+ options: {
+ options: [
+ { label: 'Strict', value: 'strict' },
+ { label: 'Warn', value: 'warn' },
+ { label: 'None', value: 'none' },
+ ],
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const queries = jiraAiHelpers.toStringList({ value: propsValue.queries });
+ if (queries.length === 0) {
+ throw new Error('Provide at least one JQL query.');
+ }
+ const response = await jiraApiCall<{ queries?: JiraRecord[] }>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: '/jql/parse',
+ query: { validation: propsValue.validation ?? 'strict' },
+ body: { queries },
+ });
+ return jiraAiHelpers.toList({ items: response.queries ?? [] });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/remove-watcher.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/remove-watcher.ts
new file mode 100644
index 00000000000..f8c0fdf63ac
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/remove-watcher.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { watcherChangeOutputSchema } from '../../output-schemas';
+export const removeWatcherAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'remove_watcher',
+ classification: 'WRITE',
+ displayName: 'Remove Watcher',
+ description: 'Removes a user from the watchers of an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Remove one user, by account ID, from the watcher list of an issue so they stop receiving its notifications. Removing another user needs the Manage watcher list permission. Not idempotent: a retry fails when the user is no longer watching.',
+ idempotent: false,
+ },
+ outputSchema: watcherChangeOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ accountId: jiraAiProps.accountId({ description: 'Account ID of the watcher to remove. Find it with Get Issue Watchers.' }),
+ },
+ async run({ auth, propsValue }) {
+ const issueIdOrKey = propsValue.issueIdOrKey.trim();
+ const accountId = propsValue.accountId.trim();
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.DELETE,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}/watchers`,
+ query: { accountId },
+ });
+ return { success: true, issue: issueIdOrKey, account_id: accountId };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-dashboards.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-dashboards.ts
new file mode 100644
index 00000000000..15712835ac0
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-dashboards.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { dashboardsOutputSchema } from '../../output-schemas';
+export const searchDashboardsAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'search_dashboards',
+ classification: 'SEARCH',
+ displayName: 'Search Dashboards',
+ description: 'Searches the dashboards visible to the user.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Search the dashboards visible to the connected user by name or owner, returning each dashboard ID, name, owner and view URL. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: dashboardsOutputSchema,
+ props: {
+ dashboardName: Property.ShortText({
+ displayName: 'Dashboard Name',
+ description: 'Only return dashboards whose name contains this text (case-insensitive).',
+ required: false,
+ }),
+ ownerAccountId: Property.ShortText({
+ displayName: 'Owner Account ID',
+ description: 'Only return dashboards owned by this user. Resolve it with Find Users.',
+ required: false,
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults({ max: 100 }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<JiraPageBean<JiraRecord>>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/dashboard/search',
+ query: {
+ dashboardName: propsValue.dashboardName,
+ accountId: propsValue.ownerAccountId,
+ startAt: propsValue.startAt,
+ maxResults: propsValue.maxResults,
+ expand: 'description,owner,viewUrl,favourite',
+ },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-filters.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-filters.ts
new file mode 100644
index 00000000000..104cf87f863
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-filters.ts
@@ -0,0 +1,57 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraPageBean, JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { filterPageOutputSchema } from '../../output-schemas';
+export const searchFiltersAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'search_filters',
+ classification: 'SEARCH',
+ displayName: 'Search Filters',
+ description: 'Searches the saved filters visible to the user.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Search the saved filters visible to the connected user by name or owner, returning each filter ID, name, owner, JQL and view URL. Use the returned JQL with Search Issues by JQL, or the filter ID with Create Board; for only the user\'s starred filters use Get Favorite Filters. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: filterPageOutputSchema,
+ props: {
+ filterName: Property.ShortText({
+ displayName: 'Filter Name',
+ description: 'Only return filters whose name contains this text (case-insensitive).',
+ required: false,
+ }),
+ ownerAccountId: Property.ShortText({
+ displayName: 'Owner Account ID',
+ description: 'Only return filters owned by this user. Resolve it with Find Users.',
+ required: false,
+ }),
+ startAt: jiraAiProps.startAt(),
+ maxResults: jiraAiProps.maxResults({ max: 100 }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await jiraApiCall<JiraPageBean<JiraRecord>>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: '/filter/search',
+ query: {
+ filterName: propsValue.filterName,
+ accountId: propsValue.ownerAccountId,
+ startAt: propsValue.startAt,
+ maxResults: propsValue.maxResults,
+ expand: 'description,owner,jql,viewUrl,favourite',
+ },
+ });
+ return jiraAiHelpers.toPage({
+ items: response.values ?? [],
+ startAt: response.startAt,
+ maxResults: response.maxResults,
+ total: response.total,
+ isLast: response.isLast,
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-issues-by-jql.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-issues-by-jql.ts
new file mode 100644
index 00000000000..289e0955005
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/search-issues-by-jql.ts
@@ -0,0 +1,77 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+
+import { searchIssuesByJqlOutputSchema } from '../../output-schemas';
+export const searchIssuesByJqlAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'search_issues_by_jql',
+ classification: 'SEARCH',
+ displayName: 'Search Issues by JQL',
+ description: 'Searches issues with a JQL query, one page at a time.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Search issues with a JQL query (e.g. project = PROJ AND assignee = currentUser() AND statusCategory != Done ORDER BY updated DESC) and return one page of up to 100 issues with a lean default field set. Pass the returned next_page_token to get the next page; for just a total use Count Issues. JQL must be bounded by at least one restriction. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: searchIssuesByJqlOutputSchema,
+ props: {
+ jql: Property.LongText({
+ displayName: 'JQL',
+ description: 'The JQL query. Use single quotes or escaped double quotes around values with spaces.',
+ required: true,
+ }),
+ fields: Property.Array({
+ displayName: 'Fields',
+ description: 'Field IDs to return. Defaults to summary, status, assignee, reporter, priority, issuetype, project, created, updated. Use *all for every field.',
+ required: false,
+ }),
+ maxResults: Property.Number({
+ displayName: 'Max Results',
+ description: 'Issues per page (1-100).',
+ required: false,
+ defaultValue: 50,
+ }),
+ nextPageToken: Property.ShortText({
+ displayName: 'Next Page Token',
+ description: 'The next_page_token from a previous call, to fetch the following page.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const maxResults = propsValue.maxResults ?? 50;
+ if (maxResults < 1 || maxResults > 100) {
+ throw new Error('Max Results must be between 1 and 100.');
+ }
+ const fields = jiraAiHelpers.toStringList({ value: propsValue.fields });
+ const response = await jiraApiCall<SearchResponse>({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: '/search/jql',
+ body: {
+ jql: propsValue.jql,
+ maxResults,
+ fields: fields.length > 0 ? fields : DEFAULT_FIELDS,
+ ...(jiraAiHelpers.isProvided(propsValue.nextPageToken) ? { nextPageToken: propsValue.nextPageToken.trim() } : {}),
+ },
+ });
+ const issues = response.issues ?? [];
+ return {
+ items: issues,
+ count: issues.length,
+ next_page_token: response.nextPageToken ?? null,
+ is_last: response.isLast ?? response.nextPageToken === undefined,
+ };
+ },
+});
+
+const DEFAULT_FIELDS = ['summary', 'status', 'assignee', 'reporter', 'priority', 'issuetype', 'project', 'created', 'updated'];
+
+type SearchResponse = {
+ issues?: JiraRecord[];
+ nextPageToken?: string;
+ isLast?: boolean;
+};
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/send-issue-notification.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/send-issue-notification.ts
new file mode 100644
index 00000000000..81d915e9622
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/send-issue-notification.ts
@@ -0,0 +1,80 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+export const sendIssueNotificationAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'send_issue_notification',
+ classification: 'WRITE',
+ displayName: 'Send Issue Notification',
+ description: 'Sends an email notification about an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Send a custom email notification about an issue to its reporter, assignee, watchers, voters, specific users (by account ID) or groups (by group ID). At least one recipient must be selected. Jira queues the email, so delivery is not confirmed. Not idempotent: every call sends another email.',
+ idempotent: false,
+ },
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Email subject. Defaults to the issue key and summary.',
+ required: false,
+ }),
+ textBody: Property.LongText({
+ displayName: 'Text Body',
+ description: 'Plain-text body of the email.',
+ required: true,
+ }),
+ htmlBody: Property.LongText({
+ displayName: 'HTML Body',
+ description: 'Optional HTML body of the email.',
+ required: false,
+ }),
+ notifyReporter: Property.Checkbox({ displayName: 'Notify Reporter', required: false, defaultValue: false }),
+ notifyAssignee: Property.Checkbox({ displayName: 'Notify Assignee', required: false, defaultValue: false }),
+ notifyWatchers: Property.Checkbox({ displayName: 'Notify Watchers', required: false, defaultValue: false }),
+ notifyVoters: Property.Checkbox({ displayName: 'Notify Voters', required: false, defaultValue: false }),
+ userAccountIds: Property.Array({
+ displayName: 'User Account IDs',
+ description: 'Account IDs of additional users to notify. Resolve them with Find Users.',
+ required: false,
+ }),
+ groupIds: Property.Array({
+ displayName: 'Group IDs',
+ description: 'IDs of groups to notify. Find them with Get User Groups.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const userAccountIds = jiraAiHelpers.toStringList({ value: propsValue.userAccountIds });
+ const groupIds = jiraAiHelpers.toStringList({ value: propsValue.groupIds });
+ const to = {
+ reporter: propsValue.notifyReporter === true,
+ assignee: propsValue.notifyAssignee === true,
+ watchers: propsValue.notifyWatchers === true,
+ voters: propsValue.notifyVoters === true,
+ users: userAccountIds.map((accountId) => ({ accountId })),
+ groupIds,
+ };
+ if (!to.reporter && !to.assignee && !to.watchers && !to.voters && userAccountIds.length === 0 && groupIds.length === 0) {
+ throw new Error('Select at least one recipient: reporter, assignee, watchers, voters, users or groups.');
+ }
+ const issueIdOrKey = propsValue.issueIdOrKey.trim();
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}/notify`,
+ body: {
+ textBody: propsValue.textBody,
+ to,
+ ...(jiraAiHelpers.isProvided(propsValue.subject) ? { subject: propsValue.subject } : {}),
+ ...(jiraAiHelpers.isProvided(propsValue.htmlBody) ? { htmlBody: propsValue.htmlBody } : {}),
+ },
+ });
+ return { success: true, issue: issueIdOrKey, queued: true };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/transition-issue-status.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/transition-issue-status.ts
new file mode 100644
index 00000000000..1eae423db24
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/transition-issue-status.ts
@@ -0,0 +1,72 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { transitionIssueStatusOutputSchema } from '../../output-schemas';
+export const transitionIssueStatusAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'transition_issue_status',
+ classification: 'WRITE',
+ displayName: 'Transition Issue Status',
+ description: 'Moves an issue through a workflow transition.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Move an issue to a new status by performing a workflow transition, optionally setting a resolution, other screen fields and a comment. Needs the numeric transition ID from Get Issue Transitions, which also shows the fields a transition requires. Not idempotent: once moved, the same transition is usually no longer available.',
+ idempotent: false,
+ },
+ outputSchema: transitionIssueStatusOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ transitionId: Property.ShortText({
+ displayName: 'Transition ID',
+ description: 'The numeric transition ID. Find it with Get Issue Transitions.',
+ required: true,
+ }),
+ resolutionId: Property.ShortText({
+ displayName: 'Resolution ID',
+ description: 'Resolution to set when the transition screen asks for one. Find it with Get Issue Resolutions.',
+ required: false,
+ }),
+ comment: jiraAiProps.optionalMarkdownText({ displayName: 'Comment', description: 'Optional comment added with the transition.' }),
+ fields: Property.Json({
+ displayName: 'Additional Fields',
+ description: 'JSON object of other transition screen field IDs to values, e.g. {"customfield_10020": "value"}.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const issueIdOrKey = propsValue.issueIdOrKey.trim();
+ const fields = {
+ ...(jiraAiHelpers.isProvided(propsValue.resolutionId) ? { resolution: { id: propsValue.resolutionId.trim() } } : {}),
+ ...(jiraAiHelpers.toRecord({ value: propsValue.fields, label: 'Additional Fields' }) ?? {}),
+ };
+ await jiraApiCall({
+ auth,
+ method: HttpMethod.POST,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}/transitions`,
+ body: {
+ transition: { id: propsValue.transitionId.trim() },
+ ...(Object.keys(fields).length > 0 ? { fields } : {}),
+ ...(jiraAiHelpers.isProvided(propsValue.comment)
+ ? { update: { comment: [{ add: { body: jiraAiHelpers.markdownToAdf({ markdown: propsValue.comment }) } }] } }
+ : {}),
+ },
+ });
+ const issue = await jiraApiCall<{ key?: string; fields?: { status?: JiraRecord } }>({
+ auth,
+ method: HttpMethod.GET,
+ resourceUri: `/issue/${encodeURIComponent(issueIdOrKey)}`,
+ query: { fields: 'status' },
+ });
+ return {
+ success: true,
+ issue: issue.key ?? issueIdOrKey,
+ transition_id: propsValue.transitionId.trim(),
+ status: issue.fields?.status ?? null,
+ };
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/update-comment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/update-comment.ts
new file mode 100644
index 00000000000..e69deb986fd
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/update-comment.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { jiraCloudAuth } from '../../../auth';
+import { jiraApiCall } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { commentOutputSchema } from '../../output-schemas';
+export const updateCommentAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'update_comment',
+ classification: 'WRITE',
+ displayName: 'Update Comment',
+ description: 'Replaces the text of a comment.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Replace the text of an existing comment on an issue with new markdown text; the comment keeps its author and visibility. Comment IDs come from List Comments, and only the author or a user with edit-all-comments permission may edit. Idempotent: writing the same text again changes nothing.',
+ idempotent: true,
+ },
+ outputSchema: commentOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ commentId: Property.ShortText({
+ displayName: 'Comment ID',
+ description: 'The numeric comment ID. Find it with List Comments.',
+ required: true,
+ }),
+ comment: jiraAiProps.markdownText({ displayName: 'Comment', description: 'The new comment text.' }),
+ notifyUsers: Property.Checkbox({
+ displayName: 'Notify Watchers',
+ required: false,
+ defaultValue: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return jiraApiCall<JiraRecord>({
+ auth,
+ method: HttpMethod.PUT,
+ resourceUri: `/issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/comment/${encodeURIComponent(propsValue.commentId.trim())}`,
+ query: { notifyUsers: String(propsValue.notifyUsers !== false) },
+ body: { body: jiraAiHelpers.markdownToAdf({ markdown: propsValue.comment }) },
+ });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/ai/upload-attachment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/ai/upload-attachment.ts
new file mode 100644
index 00000000000..67e35d33288
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/ai/upload-attachment.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import FormData from 'form-data';
+import { jiraCloudAuth } from '../../../auth';
+import { sendJiraRequest } from '../../common';
+import { JiraRecord, jiraAiHelpers } from '../../common/ai-helpers';
+import { jiraAiProps } from '../../common/ai-props';
+
+import { uploadAttachmentOutputSchema } from '../../output-schemas';
+export const uploadAttachmentAiAction = createAction({
+ auth: jiraCloudAuth,
+ name: 'upload_attachment',
+ classification: 'WRITE',
+ displayName: 'Upload Attachment',
+ description: 'Attaches a file to an issue.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Upload a file and attach it to an issue, returning the new attachment ID, name, size and content URL. Attachments must be enabled and the file within the site size limit. Not idempotent: each call adds another copy of the file.',
+ idempotent: false,
+ },
+ outputSchema: uploadAttachmentOutputSchema,
+ props: {
+ issueIdOrKey: jiraAiProps.issueIdOrKey(),
+ file: Property.File({
+ displayName: 'File',
+ required: true,
+ }),
+ fileName: Property.ShortText({
+ displayName: 'File Name',
+ description: 'Name to give the attachment, including extension. Defaults to the original file name.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const formData = new FormData();
+ const fileName = jiraAiHelpers.isProvided(propsValue.fileName) ? propsValue.fileName.trim() : propsValue.file.filename;
+ formData.append('file', Buffer.from(propsValue.file.base64, 'base64'), fileName);
+ const response = await sendJiraRequest({
+ auth,
+ method: HttpMethod.POST,
+ url: `issue/${encodeURIComponent(propsValue.issueIdOrKey.trim())}/attachments`,
+ headers: { 'X-Atlassian-Token': 'no-check', ...formData.getHeaders() },
+ body: formData,
+ });
+ const attachments: JiraRecord[] = response.body;
+ return jiraAiHelpers.toList({ items: attachments });
+ },
+});
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/assign-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/assign-issue.ts
index a3f318eb824..3190e5362b2 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/assign-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/assign-issue.ts
@@ -9,7 +9,7 @@ export const assignIssueAction = createAction({
name: 'assign_issue',
displayName: 'Assign Issue',
description: 'Assigns an issue to a user.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Set the assignee of an existing Jira issue to a chosen user, replacing any current assignee. Use to route ownership of an issue; it changes only the assignee field, nothing else. Idempotent: assigning the same user again leaves the issue unchanged.',
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/create-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/create-issue.ts
index 9c81e09ab79..2aef200e756 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/create-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/create-issue.ts
@@ -13,6 +13,7 @@ import { IssueFieldMetaData, VALID_CUSTOM_FIELD_TYPES } from '../common/types';
import { HttpMethod } from '@activepieces/pieces-common';
import { isNil } from '@activepieces/pieces-framework';
+import { issueOutputSchema } from '../output-schemas';
async function getFields(auth: JiraAuth, projectId: string, issueTypeId: string): Promise<IssueFieldMetaData[]> {
const fields = await jiraPaginatedApiCall<IssueFieldMetaData, 'fields'>({
auth: auth,
@@ -32,13 +33,14 @@ export const createIssueAction = createAction({
name: 'create_issue',
displayName: 'Create Issue',
description: 'Creates a new issue in a project.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Create a new Jira issue in a given project and issue type, with fields driven by that type\'s create screen (summary, description, custom fields, etc.); selected rich-text fields can be supplied as raw ADF JSON. Use for brand-new work items — to modify an existing one use Update Issue. Not idempotent: every run creates another issue.',
idempotent: false,
},
auth: jiraCloudAuth,
+ outputSchema: issueOutputSchema,
props: {
projectId: getProjectIdDropdown(),
issueTypeId: issueTypeIdProp('Issue Type'),
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/delete-issue-comment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/delete-issue-comment.ts
index e8cfb8f20c5..93674f8e211 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/delete-issue-comment.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/delete-issue-comment.ts
@@ -9,7 +9,7 @@ export const deleteIssueCommentAction = createAction({
name: 'delete_issue_comment',
displayName: 'Delete Issue Comment',
description: 'Deletes a comment on a specific issue.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Permanently remove a specific comment (by comment ID) from a Jira issue. Use to clean up an outdated or incorrect comment; the deletion cannot be undone. Idempotent in effect — the comment ends up gone either way — though a repeat call on an already-deleted comment returns a not-found error.',
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/find-user.ts b/packages/pieces/community/jira-cloud/src/lib/actions/find-user.ts
index c9ded709ff1..bff36daf0bf 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/find-user.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/find-user.ts
@@ -3,17 +3,19 @@ import { jiraCloudAuth } from "../../auth";
import { jiraApiCall } from "../common";
import { HttpMethod } from "@activepieces/pieces-common";
+import { legacyFindUserOutputSchema } from '../output-schemas';
export const findUserAction = createAction({
auth:jiraCloudAuth,
name:'find-user',
displayName:'Find User',
description:'Finds an existing user.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Search Jira users by a keyword matched against display name and email, returning all matches plus a found flag. Use to resolve a person\'s name or email into a Jira accountId before assigning issues or adding watchers. Read-only and idempotent.',
idempotent: true,
},
+ outputSchema: legacyFindUserOutputSchema,
props:{
keyword:Property.ShortText({
displayName:'Keyword',
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/get-issue-attachment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/get-issue-attachment.ts
index 5430d6347b6..29127d3bfa3 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/get-issue-attachment.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/get-issue-attachment.ts
@@ -3,17 +3,19 @@ import { jiraCloudAuth } from "../../auth";
import { jiraApiCall } from "../common";
import { AuthenticationType, httpClient, HttpMethod } from "@activepieces/pieces-common";
+import { legacyGetAttachmentOutputSchema } from '../output-schemas';
export const getIssueAttachmentAction = createAction({
auth: jiraCloudAuth,
name: 'get-issue-attachment',
displayName: 'Get Issue Attachment',
description: 'Retrieves an attachment from an issue.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Download a Jira attachment by its attachment ID, fetching both its metadata and the file content itself for use in later steps. Use when you already have the attachment ID (e.g. from Get Issue) and need the actual file, not just a link. Read-only and idempotent.',
idempotent: true,
},
+ outputSchema: legacyGetAttachmentOutputSchema,
props: {
attachmentId: Property.ShortText({
displayName: 'Attachment ID',
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/get-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/get-issue.ts
index eaf92f886a6..6c4c83b9bfd 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/get-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/get-issue.ts
@@ -4,17 +4,19 @@ import { HttpMethod, QueryParams } from '@activepieces/pieces-common';
import { mapFieldNames, sendJiraRequest } from '../common';
import { getIssueIdDropdown, getProjectIdDropdown } from '../common/props';
+import { issueOutputSchema } from '../output-schemas';
export const getIssueAction = createAction({
auth: jiraCloudAuth,
name: 'get_issue',
displayName: 'Get Issue',
description: 'Get issue data.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Fetch a single Jira issue by project and issue, optionally expanding extras like rendered fields, transitions, edit metadata, or changelog, and optionally remapping cryptic field/transition IDs to human-readable names. Use when you know which issue you want; to find issues by criteria use Search Issues instead. Read-only and idempotent.',
idempotent: true,
},
+ outputSchema: issueOutputSchema,
props: {
projectId: getProjectIdDropdown(),
issueId: getIssueIdDropdown({ refreshers: ['projectId'] }),
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/link-issues.ts b/packages/pieces/community/jira-cloud/src/lib/actions/link-issues.ts
index 5e32aecee6b..6404ca0dcde 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/link-issues.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/link-issues.ts
@@ -5,17 +5,19 @@ import { isNil } from '@activepieces/pieces-framework';
import { HttpMethod } from '@activepieces/pieces-common';
import { jiraApiCall } from '../common';
+import { legacyLinkIssuesOutputSchema } from '../output-schemas';
export const linkIssuesAction = createAction({
auth: jiraCloudAuth,
name: 'link-issues',
displayName: 'Link Issues',
description: 'Creates a link between two issues.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Create a directional link of a chosen type (e.g. blocks, relates to, duplicates) between two existing Jira issues, given both issue IDs/keys. Use to express dependencies or relationships; direction matters, with the first issue taking the outward role. Not idempotent: re-running can add a duplicate link.',
idempotent: false,
},
+ outputSchema: legacyLinkIssuesOutputSchema,
props: {
firstIssueId: issueIdOrKeyProp('First Issue', true),
issueLinkTypeId: issueLinkTypeIdProp('Link Type', true),
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/list-issue-comments.ts b/packages/pieces/community/jira-cloud/src/lib/actions/list-issue-comments.ts
index 245325d5926..4b03fcd2327 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/list-issue-comments.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/list-issue-comments.ts
@@ -4,17 +4,19 @@ import { HttpMethod } from '@activepieces/pieces-common';
import { sendJiraRequest } from '../common';
import { getProjectIdDropdown, getIssueIdDropdown } from '../common/props';
+import { legacyCommentPageOutputSchema } from '../output-schemas';
export const listIssueCommentsAction = createAction({
auth: jiraCloudAuth,
name: 'list_issue_comments',
displayName: 'List Issue Comments',
description: 'Returns all comments for an issue.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'List comments on a Jira issue, ordered by creation date (ascending or descending) and capped at a configurable limit, including rendered HTML bodies. Use to read an issue\'s discussion before replying or summarizing. Read-only and idempotent.',
idempotent: true,
},
+ outputSchema: legacyCommentPageOutputSchema,
props: {
projectId: getProjectIdDropdown(),
issueId: getIssueIdDropdown({ refreshers: ['projectId'] }),
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/markdown-to-jira-format.ts b/packages/pieces/community/jira-cloud/src/lib/actions/markdown-to-jira-format.ts
index 5fcfab04a3c..56b3d2aaa10 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/markdown-to-jira-format.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/markdown-to-jira-format.ts
@@ -3,6 +3,7 @@ import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
+import { markdownToAdfOutputSchema } from '../output-schemas';
export const markdownToJiraFormat = createAction({
name: 'markdownToJiraFormat',
displayName: 'Markdown to Jira format',
@@ -15,6 +16,7 @@ export const markdownToJiraFormat = createAction({
idempotent: true,
},
requireAuth: false,
+ outputSchema: markdownToAdfOutputSchema,
props: {
markdown: Property.LongText({
displayName: 'Markdown text',
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/search-issues.ts b/packages/pieces/community/jira-cloud/src/lib/actions/search-issues.ts
index 75174e338fc..8836f95a1fa 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/search-issues.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/search-issues.ts
@@ -5,17 +5,19 @@ import { searchIssuesByJql, mapFieldNames } from '../common';
import * as z from 'zod/mini'
import { propsValidation } from '@activepieces/pieces-common';
+import { issueListOutputSchema } from '../output-schemas';
export const searchIssues = createAction({
name: 'search_issues',
displayName: 'Search Issues',
description: 'Search for issues with JQL',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Search Jira issues with an arbitrary JQL query, paginating automatically up to a max-results cap (1-5000) and optionally restricting which fields are returned or mapping field IDs to readable names. The go-to tool for finding issues by project, status, assignee, dates, or any JQL-expressible criteria; limit returned fields on large result sets to avoid memory issues. Read-only and idempotent.',
idempotent: true,
},
auth: jiraCloudAuth,
+ outputSchema: issueListOutputSchema,
props: {
memoryWarning: Property.MarkDown({
value: `Fetching a large number of issues without specifying **Fields to Return** may exceed your flow's memory limits. Use field selection to reduce payload size.`,
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/transition-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/transition-issue.ts
index 02191c9a106..dddce66352c 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/transition-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/transition-issue.ts
@@ -9,18 +9,20 @@ import {
issueStatusIdProp,
} from '../common/props';
+import { legacyTransitionIssueOutputSchema } from '../output-schemas';
export const transitionIssueAction = createAction({
auth: jiraCloudAuth,
name: 'transition_issue',
displayName: 'Transition Issue',
description:
'Moves an issue to a new status by executing a workflow transition.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Execute a workflow transition on a Jira issue to move it to a new status (e.g. In Progress to Done), returning the refreshed issue. The transition must be valid from the issue\'s current status under its workflow, so it is not idempotent: re-running after the move succeeds fails because the transition is no longer available.',
idempotent: false,
},
+ outputSchema: legacyTransitionIssueOutputSchema,
props: {
projectId: getProjectIdDropdown(),
issueId: getIssueIdDropdown({ refreshers: ['projectId'] }),
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/update-issue-comment.ts b/packages/pieces/community/jira-cloud/src/lib/actions/update-issue-comment.ts
index 34710f8ddb6..cdadfce899f 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/update-issue-comment.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/update-issue-comment.ts
@@ -4,17 +4,19 @@ import { HttpMethod } from '@activepieces/pieces-common';
import { sendJiraRequest } from '../common';
import { getIssueIdDropdown, getProjectIdDropdown } from '../common/props';
+import { commentOutputSchema } from '../output-schemas';
export const updateIssueCommentAction = createAction({
auth: jiraCloudAuth,
name: 'update_issue_comment',
displayName: 'Update Issue Comment',
description: 'Updates a comment to a specific issue.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Replace the body of an existing comment (by comment ID) on a Jira issue, in plain text or raw ADF JSON when the ADF flag is set. Use to correct or extend an earlier comment instead of posting a new one with Add Issue Comment. Idempotent: re-running with the same body leaves the comment unchanged.',
idempotent: true,
},
+ outputSchema: commentOutputSchema,
props: {
projectId: getProjectIdDropdown(),
issueId: getIssueIdDropdown({ refreshers: ['projectId'] }),
diff --git a/packages/pieces/community/jira-cloud/src/lib/actions/update-issue.ts b/packages/pieces/community/jira-cloud/src/lib/actions/update-issue.ts
index d0959797f1b..ce3925b55e3 100644
--- a/packages/pieces/community/jira-cloud/src/lib/actions/update-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/actions/update-issue.ts
@@ -13,6 +13,7 @@ import { IssueFieldMetaData, VALID_CUSTOM_FIELD_TYPES } from '../common/types';
import { HttpMethod } from '@activepieces/pieces-common';
import { isNil } from '@activepieces/pieces-framework';
+import { issueOutputSchema } from '../output-schemas';
async function getFields(auth: JiraAuth, issueId: string): Promise<IssueFieldMetaData[]> {
const response = await jiraApiCall<{ fields: { [x: string]: IssueFieldMetaData } }>({
auth: auth,
@@ -36,13 +37,14 @@ export const updateIssueAction = createAction({
name: 'update_issue',
displayName: 'Update Issue',
description: 'Updates an existing issue.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Update fields on an existing Jira issue (by ID or key) using its edit screen — summary, description, custom fields, etc. — with optional ADF JSON for rich-text fields, and optionally trigger a status transition in the same run; returns the refreshed issue. Use to modify existing items rather than Create Issue. Field updates are idempotent (same values yield the same state), though a repeated status transition may fail once already applied.',
idempotent: true,
},
auth: jiraCloudAuth,
+ outputSchema: issueOutputSchema,
props: {
issueId: issueIdOrKeyProp('Issue ID or Key', true),
statusId: issueStatusIdProp('Status', false),
diff --git a/packages/pieces/community/jira-cloud/src/lib/common/ai-helpers.ts b/packages/pieces/community/jira-cloud/src/lib/common/ai-helpers.ts
new file mode 100644
index 00000000000..7c92dd9a3d0
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/common/ai-helpers.ts
@@ -0,0 +1,138 @@
+import { JSONTransformer } from '@atlaskit/editor-json-transformer';
+import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
+import { JiraAuth } from '../../auth';
+
+function browseUrl({ auth, issueKey }: { auth: JiraAuth; issueKey: string }): string {
+ return `${auth.props.instanceUrl}/browse/${issueKey}`;
+}
+
+function markdownToAdf({ markdown }: { markdown: string }): unknown {
+ const jsonTransformer = new JSONTransformer();
+ const markdownTransformer = new MarkdownTransformer();
+ return jsonTransformer.encode(markdownTransformer.parse(markdown));
+}
+
+function toPage<T>({ items, startAt, maxResults, total, isLast }: PageInput<T>) {
+ const resolvedStartAt = startAt ?? 0;
+ return {
+ items,
+ count: items.length,
+ start_at: resolvedStartAt,
+ max_results: maxResults ?? null,
+ total: total ?? null,
+ is_last: isLast ?? (total === undefined ? null : resolvedStartAt + items.length >= total),
+ };
+}
+
+function toList<T>({ items }: { items: T[] }) {
+ return { items, count: items.length };
+}
+
+function projectReference({ projectIdOrKey }: { projectIdOrKey: string }) {
+ const trimmed = projectIdOrKey.trim();
+ return /^\d+$/.test(trimmed) ? { id: trimmed } : { key: trimmed };
+}
+
+function buildIssueFields({
+ projectIdOrKey,
+ issueTypeId,
+ summary,
+ description,
+ assigneeAccountId,
+ priorityId,
+ labels,
+ parentKey,
+ dueDate,
+ extraFields,
+}: IssueFieldsInput): Record<string, unknown> {
+ return {
+ ...(extraFields ?? {}),
+ ...(isProvided(projectIdOrKey) ? { project: projectReference({ projectIdOrKey }) } : {}),
+ ...(isProvided(issueTypeId) ? { issuetype: { id: issueTypeId.trim() } } : {}),
+ ...(isProvided(summary) ? { summary } : {}),
+ ...(isProvided(description) ? { description: markdownToAdf({ markdown: description }) } : {}),
+ ...(isProvided(assigneeAccountId) ? { assignee: { accountId: assigneeAccountId.trim() } } : {}),
+ ...(isProvided(priorityId) ? { priority: { id: priorityId.trim() } } : {}),
+ ...(labels !== undefined && labels.length > 0 ? { labels } : {}),
+ ...(isProvided(parentKey) ? { parent: { key: parentKey.trim() } } : {}),
+ ...(isProvided(dueDate) ? { duedate: dueDate.trim() } : {}),
+ };
+}
+
+function toStringList({ value }: { value: unknown }): string[] {
+ if (!Array.isArray(value)) {
+ return [];
+ }
+ return value
+ .map((item) => (typeof item === 'string' || typeof item === 'number' ? String(item).trim() : ''))
+ .filter((item) => item.length > 0);
+}
+
+function toRecord({ value, label }: { value: unknown; label: string }): Record<string, unknown> | undefined {
+ if (value === undefined || value === null || value === '') {
+ return undefined;
+ }
+ if (!isRecord(value)) {
+ throw new Error(`${label} must be a JSON object.`);
+ }
+ return value;
+}
+
+function toRecordList({ value, label }: { value: unknown; label: string }): Record<string, unknown>[] {
+ if (!Array.isArray(value) || !value.every(isRecord)) {
+ throw new Error(`${label} must be a JSON array of objects.`);
+ }
+ return value;
+}
+
+function isProvided(value: string | undefined | null): value is string {
+ return value !== undefined && value !== null && value.trim().length > 0;
+}
+
+function isRecord(value: unknown): value is Record<string, unknown> {
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
+}
+
+export const jiraAiHelpers = {
+ browseUrl,
+ markdownToAdf,
+ toPage,
+ toList,
+ projectReference,
+ buildIssueFields,
+ toStringList,
+ toRecord,
+ toRecordList,
+ isProvided,
+};
+
+type PageInput<T> = {
+ items: T[];
+ startAt?: number;
+ maxResults?: number;
+ total?: number;
+ isLast?: boolean;
+};
+
+type IssueFieldsInput = {
+ projectIdOrKey?: string;
+ issueTypeId?: string;
+ summary?: string;
+ description?: string;
+ assigneeAccountId?: string;
+ priorityId?: string;
+ labels?: string[];
+ parentKey?: string;
+ dueDate?: string;
+ extraFields?: Record<string, unknown>;
+};
+
+export type JiraPageBean<T> = {
+ values?: T[];
+ startAt?: number;
+ maxResults?: number;
+ total?: number;
+ isLast?: boolean;
+};
+
+export type JiraRecord = Record<string, unknown>;
diff --git a/packages/pieces/community/jira-cloud/src/lib/common/ai-props.ts b/packages/pieces/community/jira-cloud/src/lib/common/ai-props.ts
new file mode 100644
index 00000000000..7c515f0dd15
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/common/ai-props.ts
@@ -0,0 +1,73 @@
+import { Property } from '@activepieces/pieces-framework';
+
+function issueIdOrKey({ displayName, description }: PropText = {}) {
+ return Property.ShortText({
+ displayName: displayName ?? 'Issue ID or Key',
+ description: description ?? 'The issue key (e.g. PROJ-123) or numeric issue ID. Find it with Search Issues by JQL.',
+ required: true,
+ });
+}
+
+function projectIdOrKey({ description }: PropText = {}) {
+ return Property.ShortText({
+ displayName: 'Project ID or Key',
+ description: description ?? 'The project key (e.g. PROJ) or numeric project ID. Find it with List Projects.',
+ required: true,
+ });
+}
+
+function accountId({ displayName, description }: PropText = {}) {
+ return Property.ShortText({
+ displayName: displayName ?? 'Account ID',
+ description: description ?? 'The Atlassian account ID of the user. Resolve it with Find Users or Get Current User.',
+ required: true,
+ });
+}
+
+function startAt() {
+ return Property.Number({
+ displayName: 'Start At',
+ description: 'Zero-based index of the first item to return, for pagination.',
+ required: false,
+ defaultValue: 0,
+ });
+}
+
+function maxResults({ defaultValue = 50, max }: { defaultValue?: number; max?: number } = {}) {
+ return Property.Number({
+ displayName: 'Max Results',
+ description: max === undefined ? 'Maximum number of items to return in this page.' : `Maximum number of items to return in this page (up to ${max}).`,
+ required: false,
+ defaultValue,
+ });
+}
+
+function markdownText({ displayName, description }: { displayName: string; description: string }) {
+ return Property.LongText({
+ displayName,
+ description: `${description} ${MARKDOWN_NOTE}`,
+ required: true,
+ });
+}
+
+function optionalMarkdownText({ displayName, description }: { displayName: string; description: string }) {
+ return Property.LongText({
+ displayName,
+ description: `${description} ${MARKDOWN_NOTE}`,
+ required: false,
+ });
+}
+
+export const jiraAiProps = {
+ issueIdOrKey,
+ projectIdOrKey,
+ accountId,
+ startAt,
+ maxResults,
+ markdownText,
+ optionalMarkdownText,
+};
+
+const MARKDOWN_NOTE = 'Markdown is supported and converted to Atlassian Document Format.';
+
+type PropText = { displayName?: string; description?: string };
diff --git a/packages/pieces/community/jira-cloud/src/lib/common/props.ts b/packages/pieces/community/jira-cloud/src/lib/common/props.ts
index 6815e67ff28..d856ef46643 100644
--- a/packages/pieces/community/jira-cloud/src/lib/common/props.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/common/props.ts
@@ -320,23 +320,29 @@ export const issueIdOrKeyProp = (displayName: string, required = true) =>
placeholder: 'Please connect your account first',
};
}
- const authValue = auth as JiraAuth;
- const response = await jiraPaginatedApiCall<{ id: string; key: string }, 'issues'>({
- auth: authValue,
- resourceUri: '/search',
- propertyName: 'issues',
- query: { fields: 'summary' },
- method: HttpMethod.GET,
- });
-
const options: DropdownOption<string>[] = [];
-
- for (const issue of response) {
- options.push({
- value: issue.id,
- label: issue.key,
+ let nextPageToken: string | undefined;
+ do {
+ const response = await sendJiraRequest({
+ method: HttpMethod.POST,
+ url: 'search/jql',
+ auth: auth as JiraAuth,
+ body: {
+ fields: ['summary'],
+ jql: 'created <= now() ORDER BY updated DESC',
+ nextPageToken,
+ maxResults: 100,
+ },
});
- }
+ const issueList = response.body as SearchIssuesResponse;
+ options.push(
+ ...issueList.issues.map((issue) => ({
+ value: issue.id,
+ label: issue.key,
+ })),
+ );
+ nextPageToken = issueList.isLast ? undefined : issueList.nextPageToken;
+ } while (nextPageToken && options.length < ISSUE_OPTIONS_LIMIT);
return {
disabled: false,
@@ -679,3 +685,5 @@ export function transformCustomFields(
return result;
}
+
+const ISSUE_OPTIONS_LIMIT = 1000;
diff --git a/packages/pieces/community/jira-cloud/src/lib/output-schemas.ts b/packages/pieces/community/jira-cloud/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..de07c711847
--- /dev/null
+++ b/packages/pieces/community/jira-cloud/src/lib/output-schemas.ts
@@ -0,0 +1,910 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const userFields: OutputSchema['fields'] = [
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'displayName', label: 'Display Name' },
+ { key: 'emailAddress', label: 'Email', format: 'email' },
+ { key: 'active', label: 'Active', format: 'boolean' },
+ { key: 'timeZone', label: 'Time Zone' },
+ { key: 'accountType', label: 'Account Type' },
+];
+
+const statusFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Status ID' },
+ { key: 'name', label: 'Status' },
+ { key: 'description', label: 'Description' },
+ {
+ key: 'statusCategory',
+ label: 'Status Category',
+ children: [
+ { key: 'key', label: 'Category Key' },
+ { key: 'name', label: 'Category Name' },
+ ],
+ },
+];
+
+const attachmentFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Attachment ID' },
+ { key: 'filename', label: 'File Name' },
+ { key: 'mimeType', label: 'MIME Type' },
+ { key: 'size', label: 'Size', format: 'filesize' },
+ { key: 'content', label: 'Content URL', format: 'url' },
+ { key: 'thumbnail', label: 'Thumbnail URL', format: 'image' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'author', label: 'Author', children: userFields },
+];
+
+const versionFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Version ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'released', label: 'Released', format: 'boolean' },
+ { key: 'archived', label: 'Archived', format: 'boolean' },
+ { key: 'overdue', label: 'Overdue', format: 'boolean' },
+ { key: 'startDate', label: 'Start Date', format: 'date' },
+ { key: 'releaseDate', label: 'Release Date', format: 'date' },
+ { key: 'projectId', label: 'Project ID' },
+];
+
+const issueVersionFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Version ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'released', label: 'Released', format: 'boolean' },
+ { key: 'archived', label: 'Archived', format: 'boolean' },
+ { key: 'releaseDate', label: 'Release Date', format: 'date' },
+];
+
+const issueFieldsFields: OutputSchema['fields'] = [
+ { key: 'summary', label: 'Summary' },
+ { key: 'status', label: 'Status', children: statusFields },
+ {
+ key: 'issuetype',
+ label: 'Issue Type',
+ children: [
+ { key: 'id', label: 'Issue Type ID' },
+ { key: 'name', label: 'Issue Type' },
+ { key: 'subtask', label: 'Subtask', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'priority',
+ label: 'Priority',
+ children: [
+ { key: 'id', label: 'Priority ID' },
+ { key: 'name', label: 'Priority' },
+ ],
+ },
+ {
+ key: 'project',
+ label: 'Project',
+ children: [
+ { key: 'id', label: 'Project ID' },
+ { key: 'key', label: 'Project Key' },
+ { key: 'name', label: 'Project Name' },
+ ],
+ },
+ { key: 'assignee', label: 'Assignee', children: userFields },
+ { key: 'reporter', label: 'Reporter', children: userFields },
+ { key: 'creator', label: 'Creator', children: userFields },
+ { key: 'labels', label: 'Labels' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'updated', label: 'Updated', format: 'datetime' },
+ { key: 'duedate', label: 'Due Date', format: 'date' },
+ { key: 'resolutiondate', label: 'Resolved', format: 'datetime' },
+ {
+ key: 'resolution',
+ label: 'Resolution',
+ children: [
+ { key: 'id', label: 'Resolution ID' },
+ { key: 'name', label: 'Resolution' },
+ ],
+ },
+ {
+ key: 'parent',
+ label: 'Parent',
+ children: [
+ { key: 'id', label: 'Parent ID' },
+ { key: 'key', label: 'Parent Key' },
+ ],
+ },
+ { key: 'description', label: 'Description (Atlassian Document Format)' },
+ { key: 'fixVersions', label: 'Fix Versions', labelKey: 'name', listItems: issueVersionFields },
+ { key: 'components', label: 'Components' },
+ { key: 'attachment', label: 'Attachments', labelKey: 'filename', listItems: attachmentFields },
+ {
+ key: 'issuelinks',
+ label: 'Issue Links',
+ listItems: [
+ { key: 'id', label: 'Link ID' },
+ {
+ key: 'type',
+ label: 'Link Type',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'inward', label: 'Inward Description' },
+ { key: 'outward', label: 'Outward Description' },
+ ],
+ },
+ { key: 'inwardIssue', label: 'Inward Issue', children: [{ key: 'key', label: 'Issue Key' }] },
+ { key: 'outwardIssue', label: 'Outward Issue', children: [{ key: 'key', label: 'Issue Key' }] },
+ ],
+ },
+ {
+ key: 'subtasks',
+ label: 'Subtasks',
+ labelKey: 'key',
+ listItems: [
+ { key: 'id', label: 'Issue ID' },
+ { key: 'key', label: 'Issue Key' },
+ ],
+ },
+];
+
+const issueFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Issue ID' },
+ { key: 'key', label: 'Issue Key' },
+ { key: 'self', label: 'API URL', format: 'url' },
+ { key: 'fields', label: 'Fields', children: issueFieldsFields },
+];
+
+const issueSummaryFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Issue ID' },
+ { key: 'key', label: 'Issue Key' },
+ { key: 'summary', label: 'Summary' },
+];
+
+const commentFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Comment ID' },
+ { key: 'author', label: 'Author', children: userFields },
+ { key: 'updateAuthor', label: 'Last Updated By', children: userFields },
+ { key: 'renderedBody', label: 'Body (HTML)', format: 'html' },
+ { key: 'body', label: 'Body (Atlassian Document Format)' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'updated', label: 'Updated', format: 'datetime' },
+ { key: 'jsdPublic', label: 'Public', format: 'boolean' },
+];
+
+const worklogFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Worklog ID' },
+ { key: 'issueId', label: 'Issue ID' },
+ { key: 'timeSpent', label: 'Time Spent' },
+ { key: 'timeSpentSeconds', label: 'Time Spent (Seconds)', format: 'number' },
+ { key: 'started', label: 'Started', format: 'datetime' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'updated', label: 'Updated', format: 'datetime' },
+ { key: 'author', label: 'Author', children: userFields },
+ { key: 'comment', label: 'Comment (Atlassian Document Format)' },
+];
+
+const projectFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Project ID' },
+ { key: 'key', label: 'Project Key' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'projectTypeKey', label: 'Project Type' },
+ { key: 'style', label: 'Style' },
+ { key: 'simplified', label: 'Team-Managed', format: 'boolean' },
+ { key: 'isPrivate', label: 'Private', format: 'boolean' },
+ {
+ key: 'lead',
+ label: 'Lead',
+ children: [
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'displayName', label: 'Display Name' },
+ ],
+ },
+];
+
+const issueTypeFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Issue Type ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'subtask', label: 'Subtask', format: 'boolean' },
+ { key: 'hierarchyLevel', label: 'Hierarchy Level', format: 'number' },
+ { key: 'iconUrl', label: 'Icon', format: 'image' },
+];
+
+const priorityFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Priority ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'statusColor', label: 'Color' },
+ { key: 'iconUrl', label: 'Icon', format: 'image' },
+ { key: 'isDefault', label: 'Default', format: 'boolean' },
+];
+
+const sprintFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Sprint ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'state', label: 'State' },
+ { key: 'goal', label: 'Goal' },
+ { key: 'startDate', label: 'Start Date', format: 'datetime' },
+ { key: 'endDate', label: 'End Date', format: 'datetime' },
+ { key: 'completeDate', label: 'Completed', format: 'datetime' },
+ { key: 'createdDate', label: 'Created', format: 'datetime' },
+ { key: 'originBoardId', label: 'Board ID' },
+];
+
+const filterFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Filter ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'jql', label: 'JQL' },
+ { key: 'viewUrl', label: 'View URL', format: 'url' },
+ { key: 'favourite', label: 'Favourite', format: 'boolean' },
+ {
+ key: 'owner',
+ label: 'Owner',
+ children: [
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'displayName', label: 'Display Name' },
+ ],
+ },
+];
+
+const pageMetaFields: OutputSchema['fields'] = [
+ { key: 'count', label: 'Returned', format: 'number' },
+ { key: 'start_at', label: 'Start At', format: 'number' },
+ { key: 'max_results', label: 'Max Results', format: 'number' },
+ { key: 'total', label: 'Total', format: 'number' },
+ { key: 'is_last', label: 'Last Page', format: 'boolean' },
+];
+
+const countField: OutputSchema['fields'][number] = { key: 'count', label: 'Returned', format: 'number' };
+
+const successFields: OutputSchema['fields'] = [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'issue', label: 'Issue' },
+];
+
+export const issueOutputSchema: OutputSchema = { fields: issueFields };
+
+export const issueListOutputSchema: OutputSchema = {
+ itemLabel: '{key}: {fields.summary}',
+ fields: [{ key: 'issues', label: 'Issues', value: '', listItems: issueFields }],
+};
+
+export const searchIssuesByJqlOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Issues', labelKey: 'key', listItems: issueFields },
+ countField,
+ { key: 'next_page_token', label: 'Next Page Token' },
+ { key: 'is_last', label: 'Last Page', format: 'boolean' },
+ ],
+};
+
+export const bulkGetIssuesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'issues', label: 'Issues', labelKey: 'key', listItems: issueFields },
+ { key: 'issue_errors', label: 'Issue Errors' },
+ countField,
+ ],
+};
+
+export const createdIssueOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'Issue ID' },
+ { key: 'key', label: 'Issue Key' },
+ { key: 'self', label: 'API URL', format: 'url' },
+ { key: 'browse_url', label: 'Issue URL', format: 'url' },
+ ],
+};
+
+export const bulkCreateIssuesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'issues',
+ label: 'Created Issues',
+ labelKey: 'key',
+ listItems: [
+ { key: 'id', label: 'Issue ID' },
+ { key: 'key', label: 'Issue Key' },
+ { key: 'self', label: 'API URL', format: 'url' },
+ ],
+ },
+ { key: 'errors', label: 'Errors' },
+ { key: 'created_count', label: 'Created', format: 'number' },
+ { key: 'failed_count', label: 'Failed', format: 'number' },
+ ],
+};
+
+export const countIssuesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Approximate Count', format: 'number' },
+ { key: 'jql', label: 'JQL' },
+ ],
+};
+
+export const deleteIssueOutputSchema: OutputSchema = {
+ fields: [...successFields, { key: 'deleted', label: 'Deleted', format: 'boolean' }],
+};
+
+export const assignIssueToUserOutputSchema: OutputSchema = {
+ fields: [...successFields, { key: 'assignee_account_id', label: 'Assignee Account ID' }],
+};
+
+export const transitionIssueStatusOutputSchema: OutputSchema = {
+ fields: [
+ ...successFields,
+ { key: 'transition_id', label: 'Transition ID' },
+ { key: 'status', label: 'New Status', children: statusFields },
+ ],
+};
+
+export const createIssueLinkOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'link_type', label: 'Link Type' },
+ { key: 'outward_issue', label: 'Outward Issue' },
+ { key: 'inward_issue', label: 'Inward Issue' },
+ ],
+};
+
+export const watcherChangeOutputSchema: OutputSchema = {
+ fields: [...successFields, { key: 'account_id', label: 'Account ID' }],
+};
+
+export const issueWatchersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Watchers', labelKey: 'displayName', listItems: userFields },
+ countField,
+ { key: 'watch_count', label: 'Watch Count', format: 'number' },
+ { key: 'is_watching', label: 'You Are Watching', format: 'boolean' },
+ ],
+};
+
+export const issueVotesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'votes', label: 'Votes', format: 'number' },
+ { key: 'hasVoted', label: 'You Have Voted', format: 'boolean' },
+ { key: 'voters', label: 'Voters', labelKey: 'displayName', listItems: userFields },
+ ],
+};
+
+export const remoteIssueLinksOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Remote Links' }, countField],
+};
+
+export const commentOutputSchema: OutputSchema = { fields: commentFields };
+
+export const commentPageOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Comments', labelKey: 'id', listItems: commentFields }, ...pageMetaFields],
+};
+
+export const deleteCommentOutputSchema: OutputSchema = {
+ fields: [
+ ...successFields,
+ { key: 'comment_id', label: 'Comment ID' },
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ ],
+};
+
+export const worklogOutputSchema: OutputSchema = { fields: worklogFields };
+
+export const worklogPageOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Worklogs', labelKey: 'timeSpent', listItems: worklogFields }, ...pageMetaFields],
+};
+
+export const deleteWorklogOutputSchema: OutputSchema = {
+ fields: [
+ ...successFields,
+ { key: 'worklog_id', label: 'Worklog ID' },
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ ],
+};
+
+export const uploadAttachmentOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Attachments', labelKey: 'filename', listItems: attachmentFields }, countField],
+};
+
+export const downloadAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'Attachment ID' },
+ { key: 'filename', label: 'File Name' },
+ { key: 'mime_type', label: 'MIME Type' },
+ { key: 'size', label: 'Size', format: 'filesize' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'author_account_id', label: 'Author Account ID' },
+ { key: 'author_display_name', label: 'Author' },
+ { key: 'file', label: 'File', format: 'url' },
+ ],
+};
+
+export const deleteAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'attachment_id', label: 'Attachment ID' },
+ { key: 'deleted', label: 'Deleted', format: 'boolean' },
+ ],
+};
+
+export const fieldsListOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Fields',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Field ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'custom', label: 'Custom', format: 'boolean' },
+ { key: 'searchable', label: 'Searchable', format: 'boolean' },
+ { key: 'clauseNames', label: 'JQL Names' },
+ {
+ key: 'schema',
+ label: 'Schema',
+ children: [
+ { key: 'type', label: 'Type' },
+ { key: 'items', label: 'Item Type' },
+ { key: 'custom', label: 'Custom Type' },
+ ],
+ },
+ ],
+ },
+ countField,
+ ],
+};
+
+export const issueTypeCreateFieldsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Fields',
+ labelKey: 'name',
+ listItems: [
+ { key: 'fieldId', label: 'Field ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'required', label: 'Required', format: 'boolean' },
+ { key: 'hasDefaultValue', label: 'Has Default', format: 'boolean' },
+ { key: 'schema', label: 'Schema', children: [{ key: 'type', label: 'Type' }, { key: 'items', label: 'Item Type' }] },
+ { key: 'allowedValues', label: 'Allowed Values' },
+ ],
+ },
+ ...pageMetaFields,
+ ],
+};
+
+export const issueEditMetadataOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'fields',
+ label: 'Editable Fields',
+ dynamicKey: true,
+ labelKey: 'name',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'required', label: 'Required', format: 'boolean' },
+ { key: 'operations', label: 'Operations' },
+ { key: 'allowedValues', label: 'Allowed Values' },
+ ],
+ },
+ ],
+};
+
+export const issueTransitionsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Transitions',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Transition ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'to', label: 'Target Status', children: statusFields },
+ { key: 'hasScreen', label: 'Has Screen', format: 'boolean' },
+ { key: 'isAvailable', label: 'Available', format: 'boolean' },
+ { key: 'isConditional', label: 'Conditional', format: 'boolean' },
+ { key: 'fields', label: 'Screen Fields' },
+ ],
+ },
+ countField,
+ ],
+};
+
+export const issueTypesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'items', label: 'Issue Types', labelKey: 'name', listItems: issueTypeFields },
+ countField,
+ ],
+};
+
+export const issueLinkTypesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Link Types',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Link Type ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'inward', label: 'Inward Description' },
+ { key: 'outward', label: 'Outward Description' },
+ ],
+ },
+ countField,
+ ],
+};
+
+export const resolutionsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Resolutions',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Resolution ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'isDefault', label: 'Default', format: 'boolean' },
+ ],
+ },
+ ...pageMetaFields,
+ ],
+};
+
+export const statusesOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Statuses', labelKey: 'name', listItems: statusFields }, countField],
+};
+
+export const prioritiesOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Priorities', labelKey: 'name', listItems: priorityFields }, ...pageMetaFields],
+};
+
+export const projectPageOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Projects', labelKey: 'name', listItems: projectFields }, ...pageMetaFields],
+};
+
+export const projectListOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Projects', labelKey: 'name', listItems: projectFields }, countField],
+};
+
+export const projectOutputSchema: OutputSchema = {
+ fields: [
+ ...projectFields,
+ { key: 'assigneeType', label: 'Default Assignee' },
+ { key: 'issueTypes', label: 'Issue Types', labelKey: 'name', listItems: issueTypeFields },
+ { key: 'versions', label: 'Versions', labelKey: 'name', listItems: versionFields },
+ { key: 'components', label: 'Components' },
+ ],
+};
+
+export const componentsOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Components' }, ...pageMetaFields],
+};
+
+export const versionsOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Versions', labelKey: 'name', listItems: versionFields }, ...pageMetaFields],
+};
+
+export const boardsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Boards',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Board ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'type', label: 'Type' },
+ { key: 'isPrivate', label: 'Private', format: 'boolean' },
+ {
+ key: 'location',
+ label: 'Location',
+ children: [
+ { key: 'projectId', label: 'Project ID' },
+ { key: 'projectKey', label: 'Project Key' },
+ { key: 'projectName', label: 'Project Name' },
+ ],
+ },
+ ],
+ },
+ ...pageMetaFields,
+ ],
+};
+
+export const boardOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'Board ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'type', label: 'Type' },
+ ],
+};
+
+export const sprintOutputSchema: OutputSchema = { fields: sprintFields };
+
+export const sprintsOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Sprints', labelKey: 'name', listItems: sprintFields }, ...pageMetaFields],
+};
+
+export const moveIssuesToSprintOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'sprint_id', label: 'Sprint ID' },
+ { key: 'issues', label: 'Moved Issues' },
+ countField,
+ ],
+};
+
+export const currentUserOutputSchema: OutputSchema = {
+ fields: [
+ ...userFields,
+ { key: 'locale', label: 'Locale' },
+ {
+ key: 'groups',
+ label: 'Groups',
+ children: [
+ { key: 'size', label: 'Group Count', format: 'number' },
+ {
+ key: 'items',
+ label: 'Groups',
+ labelKey: 'name',
+ listItems: [
+ { key: 'name', label: 'Name' },
+ { key: 'groupId', label: 'Group ID' },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const usersOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Users', labelKey: 'displayName', listItems: userFields }, countField],
+};
+
+export const userGroupsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Groups',
+ labelKey: 'name',
+ listItems: [
+ { key: 'name', label: 'Name' },
+ { key: 'groupId', label: 'Group ID' },
+ ],
+ },
+ countField,
+ ],
+};
+
+export const myPermissionsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Permissions',
+ labelKey: 'key',
+ listItems: [
+ { key: 'key', label: 'Permission Key' },
+ { key: 'name', label: 'Name' },
+ { key: 'type', label: 'Type' },
+ { key: 'havePermission', label: 'Granted', format: 'boolean' },
+ { key: 'description', label: 'Description' },
+ ],
+ },
+ countField,
+ ],
+};
+
+export const permittedProjectsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Projects',
+ labelKey: 'key',
+ listItems: [
+ { key: 'id', label: 'Project ID' },
+ { key: 'key', label: 'Project Key' },
+ ],
+ },
+ countField,
+ ],
+};
+
+export const filterOutputSchema: OutputSchema = {
+ fields: [
+ ...filterFields,
+ { key: 'searchUrl', label: 'Search API URL', format: 'url' },
+ { key: 'favouritedCount', label: 'Favourited By', format: 'number' },
+ ],
+};
+
+export const filterPageOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Filters', labelKey: 'name', listItems: filterFields }, ...pageMetaFields],
+};
+
+export const filterListOutputSchema: OutputSchema = {
+ fields: [{ key: 'items', label: 'Filters', labelKey: 'name', listItems: filterFields }, countField],
+};
+
+export const dashboardsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Dashboards',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'Dashboard ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'view', label: 'View Path' },
+ { key: 'isFavourite', label: 'Favourite', format: 'boolean' },
+ ],
+ },
+ ...pageMetaFields,
+ ],
+};
+
+export const jqlReferenceDataOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'fields',
+ label: 'Fields',
+ labelKey: 'displayName',
+ listItems: [
+ { key: 'value', label: 'JQL Name' },
+ { key: 'displayName', label: 'Display Name' },
+ { key: 'cfid', label: 'Custom Field Reference' },
+ { key: 'operators', label: 'Operators' },
+ { key: 'types', label: 'Types' },
+ ],
+ },
+ { key: 'field_count', label: 'Field Count', format: 'number' },
+ {
+ key: 'functions',
+ label: 'Functions',
+ labelKey: 'value',
+ listItems: [
+ { key: 'value', label: 'Function' },
+ { key: 'displayName', label: 'Display Name' },
+ ],
+ },
+ { key: 'reserved_words', label: 'Reserved Words' },
+ ],
+};
+
+export const jqlSuggestionsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Suggestions',
+ labelKey: 'value',
+ listItems: [
+ { key: 'value', label: 'Value' },
+ { key: 'displayName', label: 'Display Name', format: 'html' },
+ ],
+ },
+ countField,
+ ],
+};
+
+export const parseJqlOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Parsed Queries',
+ labelKey: 'query',
+ listItems: [
+ { key: 'query', label: 'Query' },
+ { key: 'errors', label: 'Errors' },
+ { key: 'warnings', label: 'Warnings' },
+ { key: 'structure', label: 'Structure' },
+ ],
+ },
+ countField,
+ ],
+};
+
+export const legacyAttachmentListOutputSchema: OutputSchema = {
+ itemLabel: '{filename}',
+ fields: [{ key: 'attachments', label: 'Attachments', value: '', listItems: attachmentFields }],
+};
+
+export const legacyGetAttachmentOutputSchema: OutputSchema = {
+ fields: [...attachmentFields, { key: 'file', label: 'File', format: 'url' }],
+};
+
+export const legacyCommentPageOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'comments', label: 'Comments', labelKey: 'id', listItems: commentFields },
+ { key: 'total', label: 'Total', format: 'number' },
+ { key: 'startAt', label: 'Start At', format: 'number' },
+ { key: 'maxResults', label: 'Max Results', format: 'number' },
+ ],
+};
+
+export const legacyFindUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'found', label: 'Found', format: 'boolean' },
+ { key: 'data', label: 'Users', labelKey: 'displayName', listItems: userFields },
+ ],
+};
+
+export const legacyLinkIssuesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ ],
+};
+
+export const legacyAddWatcherOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'error', label: 'Error' },
+ ],
+};
+
+export const legacyTransitionIssueOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'issue', label: 'Issue', children: issueFields },
+ ],
+};
+
+export const markdownToAdfOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'type', label: 'Document Type' },
+ { key: 'version', label: 'Version', format: 'number' },
+ { key: 'content', label: 'Content' },
+ ],
+};
+
+export const newCommentTriggerOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'issue', label: 'Issue', children: issueSummaryFields },
+ { key: 'comment', label: 'Comment', children: commentFields },
+ ],
+};
+
+export const newAttachmentTriggerOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'issue', label: 'Issue', children: issueSummaryFields },
+ { key: 'attachment', label: 'Attachment', children: attachmentFields },
+ { key: 'addedBy', label: 'Added By', children: userFields },
+ { key: 'addedAt', label: 'Added At', format: 'datetime' },
+ ],
+};
+
+export const issueAssignedTriggerOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'issue',
+ label: 'Issue',
+ children: [
+ { key: 'id', label: 'Issue ID' },
+ { key: 'key', label: 'Issue Key' },
+ { key: 'fields', label: 'Fields', children: issueFieldsFields },
+ ],
+ },
+ {
+ key: 'change',
+ label: 'Assignment',
+ children: [
+ {
+ key: 'from',
+ label: 'Previous Assignee',
+ children: [
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'displayName', label: 'Display Name' },
+ ],
+ },
+ {
+ key: 'to',
+ label: 'New Assignee',
+ children: [
+ { key: 'accountId', label: 'Account ID' },
+ { key: 'displayName', label: 'Display Name' },
+ ],
+ },
+ { key: 'by', label: 'Changed By', children: userFields },
+ { key: 'at', label: 'Changed At', format: 'datetime' },
+ ],
+ },
+ ],
+};
+
+export const issueTypeTriggerOutputSchema: OutputSchema = { fields: issueTypeFields };
+
+export const projectTriggerOutputSchema: OutputSchema = { fields: projectFields };
+
+export const priorityTriggerOutputSchema: OutputSchema = { fields: priorityFields };
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/issue-assigned.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/issue-assigned.ts
index f3b11d9ae05..664e0e01b27 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/issue-assigned.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/issue-assigned.ts
@@ -9,6 +9,7 @@ import { JiraPollingItem, JiraPollingProps, createJiraPolling } from '../common/
import { getUsersDropdown } from '../common/props';
import { ChangelogHistory } from '../common/types';
+import { issueAssignedTriggerOutputSchema } from '../output-schemas';
type IssueWithChangelog = {
id: string;
key: string;
@@ -92,6 +93,7 @@ export const issueAssigned = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: issueAssignedTriggerOutputSchema,
props: {
assignedToMe: Property.Checkbox({
displayName: 'Only when assigned to me',
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/new-attachment.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/new-attachment.ts
index 01146e75da8..28fbb4bb363 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/new-attachment.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/new-attachment.ts
@@ -8,6 +8,7 @@ import { jiraCloudAuth } from '../../auth';
import { JiraPollingItem, createJiraPolling } from '../common/polling';
import { ChangelogHistory } from '../common/types';
+import { newAttachmentTriggerOutputSchema } from '../output-schemas';
type JiraAttachment = {
id: string;
self: string;
@@ -80,6 +81,7 @@ export const newAttachment = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: newAttachmentTriggerOutputSchema,
props: {
jql: Property.LongText({
displayName: 'Only watch these issues (optional)',
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/new-comment.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/new-comment.ts
index e24f9fa055e..b540d68da90 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/new-comment.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/new-comment.ts
@@ -6,6 +6,7 @@ import {
import { jiraCloudAuth } from '../../auth';
import { JiraPollingItem, createJiraPolling } from '../common/polling';
+import { newCommentTriggerOutputSchema } from '../output-schemas';
type JiraComment = {
id: string;
self: string;
@@ -58,6 +59,7 @@ export const newComment = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: newCommentTriggerOutputSchema,
props: {
jql: Property.LongText({
displayName: 'Only watch these issues (optional)',
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/new-issue-type.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/new-issue-type.ts
index d0d5a5303d4..80d8d26e903 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/new-issue-type.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/new-issue-type.ts
@@ -3,6 +3,7 @@ import { jiraCloudAuth } from '../../auth';
import { getIssueTypes } from '../common';
import { getProjectIdDropdown } from '../common/props';
+import { issueTypeTriggerOutputSchema } from '../output-schemas';
export const newIssueType = createTrigger({
name: 'new_issue_type',
displayName: 'New Issue Type',
@@ -13,6 +14,7 @@ export const newIssueType = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: issueTypeTriggerOutputSchema,
props: {
projectId: getProjectIdDropdown({
displayName: 'Project',
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/new-issue.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/new-issue.ts
index 2d4c37dcaa3..ba9c864bb3c 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/new-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/new-issue.ts
@@ -6,6 +6,7 @@ import {
import { jiraCloudAuth } from '../../auth';
import { createJiraPolling } from '../common/polling';
+import { issueOutputSchema } from '../output-schemas';
const polling = createJiraPolling({ timeField: 'created' });
export const newIssue = createTrigger({
@@ -18,6 +19,7 @@ export const newIssue = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: issueOutputSchema,
props: {
jql: Property.LongText({
displayName: 'JQL',
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/new-priority.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/new-priority.ts
index f50ff15b6b9..c02ff1e1813 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/new-priority.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/new-priority.ts
@@ -2,6 +2,7 @@ import { TriggerStrategy, createTrigger, isNil } from '@activepieces/pieces-fram
import { jiraCloudAuth } from '../../auth';
import { getPriorities } from '../common';
+import { priorityTriggerOutputSchema } from '../output-schemas';
export const newPriority = createTrigger({
name: 'new_priority',
displayName: 'New Priority',
@@ -12,6 +13,7 @@ export const newPriority = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: priorityTriggerOutputSchema,
props: {},
sampleData: {
self: 'https://instance.atlassian.net/rest/api/3/priority/1',
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/new-project.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/new-project.ts
index 508e6699062..72d2131697f 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/new-project.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/new-project.ts
@@ -2,6 +2,7 @@ import { TriggerStrategy, createTrigger, isNil } from '@activepieces/pieces-fram
import { jiraCloudAuth } from '../../auth';
import { getProjects } from '../common';
+import { projectTriggerOutputSchema } from '../output-schemas';
export const newProject = createTrigger({
name: 'new_project',
displayName: 'New Project',
@@ -12,6 +13,7 @@ export const newProject = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: projectTriggerOutputSchema,
props: {},
sampleData: {
id: '10000',
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/updated-issue-status.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/updated-issue-status.ts
index 953283d5a10..f640af4fa08 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/updated-issue-status.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/updated-issue-status.ts
@@ -6,6 +6,7 @@ import {
import { jiraCloudAuth } from '../../auth';
import { createJiraPolling } from '../common/polling';
+import { issueOutputSchema } from '../output-schemas';
const polling = createJiraPolling({ epochField: 'statuscategorychangedate' });
export const updatedIssueStatus = createTrigger({
@@ -18,6 +19,7 @@ export const updatedIssueStatus = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: issueOutputSchema,
props: {
jql: Property.LongText({
displayName: 'JQL',
diff --git a/packages/pieces/community/jira-cloud/src/lib/triggers/updated-issue.ts b/packages/pieces/community/jira-cloud/src/lib/triggers/updated-issue.ts
index 701297698a4..1df8704cf95 100644
--- a/packages/pieces/community/jira-cloud/src/lib/triggers/updated-issue.ts
+++ b/packages/pieces/community/jira-cloud/src/lib/triggers/updated-issue.ts
@@ -6,6 +6,7 @@ import {
import { jiraCloudAuth } from '../../auth';
import { createJiraPolling } from '../common/polling';
+import { issueOutputSchema } from '../output-schemas';
const polling = createJiraPolling();
export const updatedIssue = createTrigger({
@@ -18,6 +19,7 @@ export const updatedIssue = createTrigger({
},
auth: jiraCloudAuth,
type: TriggerStrategy.POLLING,
+ outputSchema: issueOutputSchema,
props: {
jql: Property.LongText({
displayName: 'JQL',