Skip to content

Feature: Allow clearing task assignees and support job-role assignees#373

Merged
rafaeljusto merged 1 commit into
mainfrom
fix/task-assignees
Jun 26, 2026
Merged

Feature: Allow clearing task assignees and support job-role assignees#373
rafaeljusto merged 1 commit into
mainfrom
fix/task-assignees

Conversation

@rafaeljusto

Copy link
Copy Markdown
Contributor

Description

Add a clear_assignees boolean to twprojects-update_task so a task can be fully unassigned (e.g. moving to "Code Review" and dropping yourself). When set, it sends empty userIds/companyIds/teamIds/jobRoleIds arrays — the form the v3 API requires to clear — and is rejected if combined with a non-empty assignees value.

Bump twapi-go-sdk to v1.19.4, which adds the UserGroups.JobRoleIDs field and sends the "Jobroles-Enabled: true" header on every request. With that in place, wire job roles through the shared UserGroupsSchema and both parseUserGroups/parseLegacyUserGroups, so job_role_ids can be set anywhere assignee/notify groups are accepted and clear_assignees also removes them.

Add a request-body-capturing test helper (ProjectsMCPServerMockWithRequestBody) and tests covering the cleared payload, job-role assignment, and the clear_assignees/assignees conflict. Descriptions are kept generic to minimise prompt tokens.

Resolves #372

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • Tests pass locally (go test -v ./...)
  • Added/updated tests for new functionality

Checklist

  • Code follows project style guidelines
  • Self-reviewed the code
  • Added necessary documentation
  • No new warnings or errors

Add a clear_assignees boolean to twprojects-update_task so a task can be
fully unassigned (e.g. moving to "Code Review" and dropping yourself).
When set it sends empty userIds/companyIds/teamIds/jobRoleIds arrays — the
form the v3 API requires to clear — and is rejected if combined with a
non-empty assignees value.

Bump twapi-go-sdk to v1.19.4, which adds the UserGroups.JobRoleIDs field
and sends the "Jobroles-Enabled: true" header on every request. With that
in place, wire job roles through the shared UserGroupsSchema and both
parseUserGroups/parseLegacyUserGroups, so job_role_ids can be set anywhere
assignee/notify groups are accepted and clear_assignees also removes them.

Add a request-body-capturing test helper (ProjectsMCPServerMockWithRequestBody)
and tests covering the cleared payload, job-role assignment, and the
clear_assignees/assignees conflict. Descriptions are kept generic to
minimise prompt tokens.

Resolves #372
@rafaeljusto rafaeljusto requested a review from a team as a code owner June 26, 2026 18:37
@rafaeljusto rafaeljusto merged commit cc84e50 into main Jun 26, 2026
3 checks passed
@rafaeljusto rafaeljusto deleted the fix/task-assignees branch June 26, 2026 18:44
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.

twprojects-update_task cannot clear/remove task assignees (unassign)

1 participant