Repository navigation
feat(issue): accept a bare issue key for issuelink fields - #10
Merged
Merged
Conversation
added 2 commits
August 14, 2026 11:10
Setting a parent or any other issuelink field meant hand-writing the JSON
object the API wants, because the coercion had no branch for the type and
fell through to "parse as JSON, else send the string". A bare key came back
as `parent: data was not an object`, which says nothing about the fix.
Coerce issuelink fields to {"key": ...} for a key and {"id": ...} for a
numeric id, so `--field Parent=PROJ-1` works. An explicit JSON object is
still passed through unchanged.
Spenhouet
force-pushed
the
feat/issuelink-bare-key
branch
from
August 14, 2026 09:11
882cc55 to
687ab07
Compare
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.
Problem
coerce_valuehad no branch for theissuelinkschema type, so a parent or linked-issue field fell through to the catch-all: tryjson.loads, otherwise send the raw string. Setting an epic therefore required hand-writing the object:The error names the field and the shape it wanted, but not the syntax that would satisfy it.
Change
Coerce
issuelinkfields the same way the other object-shaped types are already coerced (priority,version,component,resolution,project): a bare key becomes{"key": "PROJ-1"}, an all-digit value becomes{"id": "10023"}, and a value that already looks like JSON is parsed and passed through unchanged. Malformed JSON falls back to the key form rather than raising.Testing
tests/test_jira_fields.py, the module had no tests. 18 cases covering field resolution by id, display name and hyphenated name, the unknown-field error, all four issuelink paths, and the existing number, array, option, unknown-type and user-type behaviour.uv run pytest: 114 passed.uv run ruff check: clean.bj issue edit AIRA-3789 --field 'Parent=AIRA-3775'succeeded and reading the issue back showsparent: AIRA-3775.Note
#9 documents the old object-only form. Its wording needs one line updated once this lands, whichever order the two merge in.