Skip to content

fix: Sync custom field options for known option types only#317

Merged
ReubenFrankel merged 2 commits intoMeltanoLabs:mainfrom
definite-app:def/options_fix
Mar 17, 2026
Merged

fix: Sync custom field options for known option types only#317
ReubenFrankel merged 2 commits intoMeltanoLabs:mainfrom
definite-app:def/options_fix

Conversation

@steven-luabase
Copy link
Copy Markdown
Contributor

We ran into an error after this PR: #314

Not sure if it's just our Jira instance but we have some custom fields that return type option and others with type option2. Those with option2 do not work when supports_options = true:
singer_sdk.exceptions.FatalAPIError: 400 Client Error: Bad Request for path: /rest/api/3/field/customfield_10090/context/10212/option, content is {\"errorMessages\":[\"The custom field doesn't support options.\"]

This PR makes an explicit check for if type_ = option.

@steven-luabase steven-luabase requested a review from a team as a code owner March 16, 2026 20:04
@ReubenFrankel
Copy link
Copy Markdown
Contributor

ReubenFrankel commented Mar 16, 2026

In our case, we have types of option and option-with-child, hence

            supports_options = type_.startswith("option")

Perhaps we would be better off matching against a set of known option types, starting with the above two:

            type_: str = schema.get("items") or schema["type"]
            supports_options = type_ in {"option", "option-with-child"}

@steven-luabase
Copy link
Copy Markdown
Contributor Author

@ReubenFrankel updated per your comments and added a check for known option types

@ReubenFrankel ReubenFrankel changed the title fix: custom fields options fix (explicitly check for options) fix: Sync custom field options for known option types only Mar 17, 2026
@ReubenFrankel ReubenFrankel added this pull request to the merge queue Mar 17, 2026
Merged via the queue into MeltanoLabs:main with commit 22a7c91 Mar 17, 2026
2 checks passed
@ReubenFrankel
Copy link
Copy Markdown
Contributor

Cheers @steven-luabase

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.

2 participants