feat(testmanagement): template selection + multi-select custom fields#319
Merged
Merged
Conversation
…tom fields createTestCase gains an optional `template` (internal slug, e.g. test_case_steps or test_case_bdd) passed through to the TM v2 create endpoint, with a warning when the API silently falls back to the default for an unrecognized value. Display names are not accepted and the form-fields endpoint does not enumerate templates, so slug pass-through is the only viable approach. template is create-only -- the PATCH/update endpoint ignores it -- so it is not added to updateTestCase. custom_fields on both create and update now accept array values, enabling multi-select custom fields (keyed by field name). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ruturaj-browserstack
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes a customer blocker in the Test Management
createTestCase/updateTestCasetools. Two gaps:custom_fieldscouldn't hold multiple values — the Zod schema restricted values tostring | number | boolean, blocking arrays, so multi-select custom fields couldn't be set programmatically.How the contract was determined
I probed the live TM v2 API (a project with real custom fields incl. a
field_multi_dropdown) before writing code:test_case_bddwas recognized (HTTP 422"Scenario is required for BDD test cases"). A display name ("Test Case BDD") was silently ignored and fell back totest_case_steps.form-fields-v2does not enumerate templates and there's no template-list endpoint, so resolving display→slug server-side isn't possible. Pass-through of the slug is the only viable approach.templateis create-only. The PATCH/update endpoint ignores it (even a valid slug didn't switch the template), sotemplateis intentionally not added toupdateTestCase.{ "Field Name": ["opt1","opt2"] }. Keying by field id or a CSV string is silently dropped.Changes
create-testcase.ts: optionaltemplateparam (slug, pass-through) + a mismatch warning when the API silently falls back;custom_fieldswidened to accept arrays (multi-select). New exportedCustomFieldValuetype +customFieldValueSchema.update-testcase.ts:custom_fieldswidened to accept arrays. Notemplate(API ignores it on update).testmanagement.test.ts: +4 tests — slug pass-through, the silent-fallback warning, and arraycustom_fieldson both create and update. (apiClientmock gainedpatch.)Testing
npm run buildpasses locally — lint, format, 186 tests (4 new), andtscall green.Known limitation
Switching an existing test case's template via
updateTestCaseis not supported by the TM API — it ignores thetemplatefield on PATCH. Template can only be set at creation; supporting post-creation switching would need a TM backend change.🤖 Generated with Claude Code