Skip to content

Conversation

conor-naranjo
Copy link

… endpoints

What type of PR is this?

  • bug

What this PR does / why we need it:

The endpoint GET /rest/api/2|3|latest/search is being deprecated. This is the migration of the endpoint.

See https://developer.atlassian.com/changelog/#CHANGE-2046

Which issue(s) this PR fixes:

Fixes #715

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:

@conor-naranjo conor-naranjo changed the base branch from main to v1.16.1-dev August 28, 2025 19:43
@conor-naranjo conor-naranjo force-pushed the fix/search-jql-api-deprecation branch from 9d1a1dc to c6c2ebc Compare August 28, 2025 19:46
Copy link

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @conor-naranjo added a couple of comments. Noticed them while testing the PR

@conor-naranjo conor-naranjo force-pushed the fix/search-jql-api-deprecation branch from c6c2ebc to f22badc Compare September 1, 2025 17:38
@conor-naranjo
Copy link
Author

@erezrokah Thanks for the review and callout. Addressed the mismatched function calls and ensured go build succeeds.

Copy link

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

Tested this approach a bit more, and it doesn't work as the v3 API returns a response with a different structure, so JSON unmarshalling fails. For example in v2 fields.description is a string and in v3 it's an object.

The Go struct expects a string.

A possible working solution is to use the v2 API, see cloudquery@9f996e4

Oddly enough Jira docs have it the other way around, v2 says it returns an object and v3 says it returns a string, but I confirmed v2 returns a string

image image

@conor-naranjo conor-naranjo force-pushed the fix/search-jql-api-deprecation branch from f22badc to 144d3c7 Compare September 3, 2025 02:22
Copy link

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

Thanks for updating the PR, we should also rename v3 to v2 where applicable

mmikitka-arcticwolf added a commit to mmikitka-arcticwolf/go-jira that referenced this pull request Sep 3, 2025
@conor-naranjo conor-naranjo force-pushed the fix/search-jql-api-deprecation branch from 144d3c7 to 756718b Compare September 4, 2025 00:11
@mspraggs
Copy link

mspraggs commented Sep 4, 2025

Hello 🙂

Thought Machine maintains a fork of this repo with some minor modifications to the v1 branch. Today we used the change in this PR as part of a separate PR here and found the changes worked well with our internal workloads. Just reporting back to let you know these changes work well "in the wild".

Many thanks

Matt

@cxfcxf
Copy link

cxfcxf commented Sep 8, 2025

I think there is no need to do V2/V3 for extra struct, just fix the original struct since its not gonna work anymore.

@conor-naranjo
Copy link
Author

@cxfcxf as I understand it, the new SearchOptionsV2 struct is to provide a cloud API-specific search options to maintain compatibility with on-prem because the v1 version of go-jira doesn't have a separate cloud vs on-prem client

@cxfcxf
Copy link

cxfcxf commented Sep 9, 2025

@cxfcxf as I understand it, the new SearchOptionsV2 struct is to provide a cloud API-specific search options to maintain compatibility with on-prem because the v1 version of go-jira doesn't have a separate cloud vs on-prem client

ah make sense, thanks for the explanation, we moved to cloud but my app still uses default search function (developed on-prem), which worked until recently they shut off the old api endpoint. so i was wondering if there is a way to just fix the search function on library.

@conor-naranjo
Copy link
Author

@cxfcxf that's what this PR is intended to address for the v1 version of the lib.
the v2 library (main branch -- not released) has separate JiraClient for cloud or on-prem with separate implementations

There's #724 to address fixing v2

@andygrunwald andygrunwald changed the title Add SearchV3 to fix deprecation of JQL search and evaluate expression… Add SearchV2JQL to fix deprecation of JQL search and evaluate expression… Sep 13, 2025
@andygrunwald andygrunwald merged commit f4a2f9d into andygrunwald:v1.16.1-dev Sep 13, 2025
0 of 6 checks passed
@andygrunwald
Copy link
Owner

Huge shoutout to @conor-naranjo for creating the PR, @erezrokah for the thorough review and @mspraggs for the "it works" confirmation.

I merged the PR and released v1.16.1. I will backport this PR into the current main version as well.

@andygrunwald
Copy link
Owner

Hey all,
please see my latest comment in #715 (comment) with an update on this one here.

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.

Some APIs used will be shutdown on May 1st 2025
5 participants