-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Jira - Search for issues using JQL #16642
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 Git ↗︎ |
WalkthroughA new Jira action module named "Search Issues with JQL" has been added, enabling users to search for Jira issues using JQL with customizable parameters. Additionally, the Jira integration package version was incremented from 0.1.4 to 0.2.0. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SearchIssuesWithJQLAction
participant JiraAPI
User->>SearchIssuesWithJQLAction: Provide JQL query and parameters
SearchIssuesWithJQLAction->>JiraAPI: Send search request with JQL and options
JiraAPI-->>SearchIssuesWithJQLAction: Return search results
SearchIssuesWithJQLAction-->>User: Return results and summary message
Assessment against linked issues
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (3)
components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs (3)
74-79
: Consider adding validation for properties parameter.The Jira API documentation specifies that up to 5 properties can be included, but there's no validation for this limit in the code. Consider adding validation to ensure the comma-separated list doesn't exceed 5 items.
You could add something like:
properties: { type: "string", label: "Properties", description: "A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list.", optional: true, + validator: (value) => { + if (value && value.split(",").length > 5) { + return "You can specify a maximum of 5 properties"; + } + return true; + }, },
107-116
: Consider adding input validation for JQL.JQL queries can be complex, and invalid queries will be rejected by the Jira API. Consider adding basic validation or sanitization for the JQL input to provide better error messages before making the API request.
You could add a validator function to the JQL prop:
jql: { type: "string", label: "JQL Query", description: "The [JQL](https://support.atlassian.com/jira-software-cloud/docs/what-is-advanced-search-in-jira-cloud/) query to search for issues", + validator: (value) => { + if (!value || value.trim() === "") { + return "JQL query cannot be empty"; + } + return true; + }, },
118-118
: Consider adding zero results handling.The summary message assumes there will always be issues returned. Consider adding a conditional check to handle the case when no issues are found.
- $.export("$summary", `Successfully retrieved ${response.issues.length} issues`); + const issueCount = response.issues?.length || 0; + $.export("$summary", issueCount > 0 + ? `Successfully retrieved ${issueCount} issues` + : "No issues found matching the JQL query");
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs
(1 hunks)components/jira/package.json
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (5)
components/jira/package.json (1)
3-3
: Version bump appropriate for new feature addition.The update from 0.1.4 to 0.2.0 correctly follows semantic versioning principles as this PR adds a new feature (Search Issues with JQL action) without breaking existing functionality.
components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs (4)
3-8
: LGTM: Clear module definition with appropriate metadata.The action definition includes a descriptive name, detailed description with link to documentation, unique key, and proper version for a new component.
9-92
: Props definition is comprehensive with good descriptions.All necessary parameters for the Jira JQL search API are included with appropriate types, labels, descriptions, and constraints where applicable. The expand options are well documented with clear descriptions for each value.
93-100
: LGTM: Clean method implementation.The
searchIssues
method correctly wraps the Jira API call with proper path specification.
101-123
: Run method looks good with proper error handling.The run method correctly assembles parameters, handles optional values, provides a clear summary message, and includes proper error handling. The
expand
array is correctly joined into a comma-separated string as required by the API.
Resolves #16591
Summary by CodeRabbit
New Features
Chores