Skip to content

fix(Jira): update endpoint for issue search to use 'search/jql' inste…#6236

Open
HeadedWeast wants to merge 1 commit intoFlowiseAI:mainfrom
HeadedWeast:bugfix/Jira-list_issues-API-Update
Open

fix(Jira): update endpoint for issue search to use 'search/jql' inste…#6236
HeadedWeast wants to merge 1 commit intoFlowiseAI:mainfrom
HeadedWeast:bugfix/Jira-list_issues-API-Update

Conversation

@HeadedWeast
Copy link
Copy Markdown

…ad of 'search'

in it's current state, using the list_issues tool for Jira results in the following tool output:
Error listing issues: Error: Jira API Error 410: Gone - {"errorMessages":["The requested API has been removed. Please migrate to the /rest/api/3/search/jql API. A full migration guideline is available at https://developer.atlassian.com/changelog/#CHANGE-2046"],"errors":{}}

This pull request resolves that error.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Jira search endpoint to use 'search/jql'. A review comment identifies that this change is specific to Jira Cloud API v3 and would break compatibility with Jira Server or Data Center versions. It is recommended to conditionally set the endpoint based on the API version.

if (params.startAt) queryParams.append('startAt', params.startAt.toString())

const endpoint = `search?${queryParams.toString()}`
const endpoint = `search/jql?${queryParams.toString()}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The search/jql endpoint is specific to Jira Cloud API v3. For Jira Server or Data Center (which use API v2), the endpoint remains search. Since this component supports both versions (determined by the apiVersion property), forcing search/jql will break functionality for users on Jira Server/DC. You should conditionally set the endpoint based on the API version.

Suggested change
const endpoint = `search/jql?${queryParams.toString()}`
const endpoint = (this.apiVersion === '3' ? 'search/jql' : 'search') + '?' + queryParams.toString()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this valid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants