Skip to content

Conversation

@petzbloom-sudo
Copy link

This change adds the "assignees" to the card.json.jbuilder partial.

Currently, the card JSON payload (used by both the API and Webhooks) includes the creator but omits assignment data. This makes it hard for webhook integrations to determine who is responsible for a card.

I have added the "assignees" collection to the standard card JSON response, reusing the existing "users/user" partial to ensure data consistency.

Note to Maintainers
I am a "low-code" contributor and do not have a local Rails environment set up to test this. I tried to update the webhook builder Json but it got closed so I'm trying again this way directly in the card.

Thanks,
Bloom

Jbuilder: Include assignees in card data
Copy link
Member

@jorgemanrubia jorgemanrubia left a comment

Choose a reason for hiding this comment

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

This makes sense to me. What do you think @monorkin?

json.board card.board, partial: "boards/board", as: :board
json.column card.column, partial: "columns/column", as: :column if card.column
json.creator card.creator, partial: "users/user", as: :user
json.assignees card.assignees, partial: "users/user", as: :user
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @petzbloom-sudo Nice work! I believe we could also update https://github.com/basecamp/fizzy/blob/main/docs/API.md?plain=1#L464, where there’s an example of the payload. What do you think?

@monorkin
Copy link
Contributor

monorkin commented Dec 15, 2025

@petzbloom-sudo @jorgemanrubia agreed, this makes sense.
We should also look into capping the number of asignees on a card so that this can't be exploited for a DoS, I'll add a limit for that and then merge this in.

@monorkin
Copy link
Contributor

@petzbloom-sudo could we change your PR such that the partial returns the first few asignees, e.g. 3 or 5, and indicated if there are more on the show page?

I did just merge a limit to the number of assignees on a card, but it's really high for an API response.

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.

4 participants