-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Jira - create-issue improvements #18962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughVersion metadata updated across many Jira components. The Create Issue action gained dynamic-field retrieval, validation, and error handling changes. The Jira app added a getUserIssueTypes method and conditional issueType option loading; package version incremented. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CreateIssue as create-issue action
participant JiraApp as jira.app
participant JiraAPI as Jira API
User->>CreateIssue: invoke create-issue (projectId, cloudId, issueTypeId, additionalProps)
CreateIssue->>CreateIssue: validate projectId/cloudId/issueTypeId
alt Invalid input
CreateIssue-->>User: throw ConfigurationError
else Valid input
CreateIssue->>JiraApp: getCreateIssueMetadata(...)
opt metadata request
JiraApp->>JiraAPI: GET /rest/api/3/issue/createmeta
JiraAPI-->>JiraApp: metadata
end
alt metadata success
CreateIssue->>CreateIssue: extract & filter dynamicFields
CreateIssue->>JiraAPI: POST /rest/api/3/issue (dynamicFields + additionalProps)
JiraAPI-->>CreateIssue: success
CreateIssue-->>User: return created issue
else metadata failure
CreateIssue->>CreateIssue: mark additionalProperties non-optional
CreateIssue-->>User: throw ConfigurationError if no additionalProps
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/jira/actions/delete-project/delete-project.mjs (1)
46-46: Critical pre-existing bug: Template string not using backticks.Line 46 uses double quotes instead of backticks, so the variable
${this.projectID}won't be interpolated and will appear literally in the output. Additionally, "successfuly" should be "successfully".Apply this fix (note: this is pre-existing, not introduced by this PR):
- $.export("$summary", "Project with ID: ${this.projectID} has been deleted successfuly."); + $.export("$summary", `Project with ID: ${this.projectID} has been deleted successfully.`);Would you like me to open a separate issue to track this fix?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (26)
components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs(1 hunks)components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs(1 hunks)components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs(1 hunks)components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs(1 hunks)components/jira/actions/assign-issue/assign-issue.mjs(1 hunks)components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs(1 hunks)components/jira/actions/create-issue/create-issue.mjs(3 hunks)components/jira/actions/create-version/create-version.mjs(1 hunks)components/jira/actions/delete-project/delete-project.mjs(1 hunks)components/jira/actions/get-all-projects/get-all-projects.mjs(1 hunks)components/jira/actions/get-issue/get-issue.mjs(1 hunks)components/jira/actions/get-task/get-task.mjs(1 hunks)components/jira/actions/get-transitions/get-transitions.mjs(1 hunks)components/jira/actions/get-user/get-user.mjs(1 hunks)components/jira/actions/get-users/get-users.mjs(1 hunks)components/jira/actions/list-issue-comments/list-issue-comments.mjs(1 hunks)components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs(1 hunks)components/jira/actions/transition-issue/transition-issue.mjs(1 hunks)components/jira/actions/update-comment/update-comment.mjs(1 hunks)components/jira/actions/update-issue/update-issue.mjs(1 hunks)components/jira/jira.app.mjs(4 hunks)components/jira/package.json(1 hunks)components/jira/sources/events/events.mjs(1 hunks)components/jira/sources/issue-created/issue-created.mjs(1 hunks)components/jira/sources/issue-deleted/issue-deleted.mjs(1 hunks)components/jira/sources/issue-updated/issue-updated.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-01-23T03:55:15.166Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Applied to files:
components/jira/sources/issue-updated/issue-updated.mjs
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs
📚 Learning: 2025-08-19T09:02:00.906Z
Learnt from: nurul3101
Repo: PipedreamHQ/pipedream PR: 18092
File: components/prisma_management_api/README.md:42-47
Timestamp: 2025-08-19T09:02:00.906Z
Learning: In Prisma Management API documentation, the "Delete Database" action intentionally uses this name even though it technically deletes an entire project (including all associated databases and resources) via projectId. This naming choice is deliberate and should not be flagged as inconsistent.
Applied to files:
components/jira/actions/delete-project/delete-project.mjs
🧬 Code graph analysis (2)
components/jira/actions/create-issue/create-issue.mjs (1)
components/jira/actions/update-issue/update-issue.mjs (3)
projectId(113-128)keys(130-133)dynamicFields(142-160)
components/jira/jira.app.mjs (3)
components/jira/actions/common/issue.mjs (1)
issueTypes(104-106)components/jira/actions/update-issue/update-issue.mjs (1)
projectId(113-128)components/jira/actions/create-issue/create-issue.mjs (1)
projectId(62-77)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (28)
components/jira/actions/get-users/get-users.mjs (1)
7-7: LGTM: Coordinated version bump.The version increment is consistent with the broader package update across Jira components.
components/jira/actions/update-comment/update-comment.mjs (1)
10-10: LGTM: Version bump aligns with package update.components/jira/actions/get-transitions/get-transitions.mjs (1)
7-7: LGTM: Consistent version increment.components/jira/actions/list-issue-comments/list-issue-comments.mjs (1)
7-7: LGTM: Version update is appropriate.components/jira/package.json (1)
3-3: LGTM: Package version bump aligns with component updates.The version increment from 1.1.2 to 1.1.3 is consistent with the coordinated version bumps across all Jira action components in this PR.
components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs (1)
9-9: LGTM: Version increment is consistent.components/jira/actions/delete-project/delete-project.mjs (1)
7-7: LGTM: Version bump is appropriate.components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs (1)
9-9: LGTM: Version update is consistent with the package release.components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs (1)
8-8: LGTM: Version metadata bump.This is a metadata-only change incrementing the action version from 0.0.6 to 0.0.7, with no functional modifications.
components/jira/actions/get-issue/get-issue.mjs (1)
7-7: LGTM: Version metadata bump.This is a metadata-only change incrementing the action version from 0.1.16 to 0.1.17, with no functional modifications.
components/jira/actions/transition-issue/transition-issue.mjs (1)
8-8: LGTM: Version metadata bump.This is a metadata-only change incrementing the action version from 0.1.16 to 0.1.17, with no functional modifications.
components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs (1)
10-10: LGTM: Version metadata bump.This is a metadata-only change incrementing the action version from 0.1.14 to 0.1.15, with no functional modifications.
components/jira/actions/assign-issue/assign-issue.mjs (1)
6-6: LGTM: Version metadata bump.This is a metadata-only change incrementing the action version from 0.0.13 to 0.0.14, with no functional modifications.
components/jira/actions/get-task/get-task.mjs (1)
7-7: LGTM: Version metadata bump.This is a metadata-only change incrementing the action version from 0.1.14 to 0.1.15, with no functional modifications.
components/jira/sources/issue-created/issue-created.mjs (1)
7-7: LGTM: Version metadata bump.This is a metadata-only change incrementing the source version from 0.0.14 to 0.0.15, with no functional modifications.
components/jira/sources/events/events.mjs (1)
8-8: LGTM: Version metadata bump.This is a metadata-only change incrementing the source version from 0.0.14 to 0.0.15, with no functional modifications.
components/jira/actions/get-user/get-user.mjs (1)
7-7: LGTM! Routine version bump.Version incremented as part of package maintenance.
components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs (1)
7-7: LGTM! Routine version bump.Version incremented as part of package maintenance.
components/jira/sources/issue-deleted/issue-deleted.mjs (1)
7-7: LGTM! Routine version bump.Version incremented as part of package maintenance.
components/jira/actions/update-issue/update-issue.mjs (1)
11-11: LGTM! Routine version bump.Version incremented as part of package maintenance.
components/jira/sources/issue-updated/issue-updated.mjs (1)
7-7: LGTM! Routine version bump.Version incremented as part of package maintenance.
components/jira/actions/create-version/create-version.mjs (1)
7-7: LGTM! Routine version bump.Version incremented as part of package maintenance.
components/jira/actions/get-all-projects/get-all-projects.mjs (1)
7-7: LGTM! Routine version bump.Version incremented as part of package maintenance.
components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs (1)
6-6: LGTM! Routine version bump.Version incremented as part of package maintenance.
components/jira/jira.app.mjs (2)
63-72: LGTM! Conditional issue type fetching supports the PR objective.The conditional logic appropriately falls back to user-level issue types when
projectIdis invalid or not yet selected, enabling the component to work without a project context. This supports the PR's goal of handling cases where dynamic props don't load correctly.
604-609: LGTM! New method properly implemented.The
getUserIssueTypesmethod follows the established pattern of other API methods in this file and correctly calls the user-level issue types endpoint.components/jira/actions/create-issue/create-issue.mjs (2)
61-92: Good implementation of the fallback mechanism.Assuming the condition on line 56 is fixed, this implementation correctly addresses the PR objective by providing a fallback to
additionalPropertieswhen dynamic props cannot be generated. The try-catch pattern ensures resilience, and the field filtering logic appropriately excludesprojectandissuetypewhich are already handled as dedicated props.
109-113: LGTM! Proper validation ensures data is provided.The validation correctly enforces that at least one of dynamic fields or
additionalPropertiesmust be provided, preventing issues from being created without sufficient data. This aligns with the PR objective of supporting multiple ways to pass data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/jira/actions/create-issue/create-issue.mjs(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/jira/actions/create-issue/create-issue.mjs (1)
components/jira/actions/update-issue/update-issue.mjs (3)
projectId(113-128)keys(130-133)dynamicFields(142-160)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (5)
components/jira/actions/create-issue/create-issue.mjs (5)
4-4: LGTM!The
ConfigurationErrorimport is appropriately used in the runtime validation at line 112.
10-11: LGTM!The version bump and documentation link update are appropriate for these changes.
62-88: LGTM!The metadata retrieval and dynamic field generation logic is well-structured and consistent with the
update-issue.mjsimplementation. Excluding theISSUETYPEandPROJECTkeys is appropriate since they're already defined as props (lines 26-47), and settingadditionalProperties.optional = trueon success correctly enables the fallback mechanism.
109-113: LGTM!This runtime validation effectively addresses the PR objective by ensuring that at least one method of providing field data (either
dynamicFieldsoradditionalProperties) is available. The use of the AND operator correctly requires both to be empty before throwing the error, allowingadditionalPropertiesto serve as a fallback when dynamic props fail to load.
49-59: No action required — review comment is unfounded.The
additionalPropertiesprop is defined as a required field incomponents/jira/actions/common/issue.mjs(lines 32-37) without anoptional: trueflag. Unlike other optional props in the same file (updateProperties,properties,updateIssue), this ensures the property will always be present inexistingPropswhen the framework callsadditionalProps(). AccessingexistingProps.additionalProperties.optionalat lines 57, 84, and 90 is safe. The defensive check at line 110 only validates whether the object is empty, not whether it exists.
luancazarine
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @michelle0927, LGTM! Ready for QA!
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
Resolves #18948
Summary by CodeRabbit
New Features
Bug Fixes
Chores