Skip to content

connect add on an existing connection discards configured fields; board_id is never persisted #108

Closed

Description

@f3rdy

Two independent defects in the connection write path, found while adding a new
connection-level setting (#106).

1. connect add on an existing connection resets everything it does not ask for

budjira/cli/connect.py::add_connection builds a fresh Connection from the four
values it prompts for and hands that to settings.update_connection(), which replaces
the whole entry. Every field the command does not ask for falls back to its default:
tempo_enabled, custom_fields, ai_prompt, cache_enabled, cache_ttl_hours,
is_active.

connect add is documented as "Add or update a Jira connection" and is the only
way to change a connection's URL, email or project key, so the loss happens on the
supported edit path - silently, and precisely on the connections that carry the most
configuration.

Reproduce (isolated config)

export XDG_CONFIG_HOME=$(mktemp -d) XDG_DATA_HOME=$(mktemp -d)
# create a connection with tempo, a custom field and an ai_prompt, then:
printf 'y\ntoken\n' | budjira -q connect add --name demo \
  --url https://company.atlassian.net --email user@example.com --project PROJ

connections.toml before:

tempo_enabled = true
ai_prompt = "house rules"

[connections.custom_fields.system]
field_id = "customfield_10001"
type = "select"

after:

tempo_enabled = false
# ai_prompt and custom_fields are gone

Expected

Updating an existing connection changes the values that were given and leaves the rest
untouched (e.g. carry the stored connection forward with model_copy(update=...)
instead of constructing a new one).

2. board_id is never written to connections.toml

Settings._serialize_connection() does not include board_id, so the field is dropped
on every save, not just on update. A board configured for sprint operations is lost as
soon as any connection is written back.

Reproduce

Create a connection with board_id set and inspect connections.toml - the key is
absent.

Expected

board_id round-trips like the other optional fields (ai_prompt, custom_fields),
i.e. written when set, omitted when None.

Notes

A regression test per defect: one that updates a fully configured connection through
the CLI and asserts the untouched fields survive, one that round-trips a connection
with board_id through save and load.

Activity

  1. added
    bug
    priority:medium
    on Aug 13, 2026
  2. f3rdy commented on Aug 13, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions