Skip to content

Conversation

danhellem
Copy link
Contributor

@danhellem danhellem commented Jul 29, 2025

Added a transformation on get work items in batch to only show the AssignedTo value and not a complex object

GitHub issue number #327

Associated Risks

N/A

PR Checklist

  • I have read the contribution guidelines
  • I have read the code of conduct guidelines
  • Title of the pull request is clear and informative.
  • 👌 Code hygiene
  • 🔭 Telemetry added, updated, or N/A
  • 📄 Documentation added, updated, or N/A
  • 🛡️ Automated tests added, or N/A

🧪 How did you test it?

Manual tests. Updated automated tests

@danhellem danhellem requested a review from a team as a code owner July 29, 2025 12:59
Copy link

github-actions bot commented Jul 29, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@danhellem danhellem self-assigned this Jul 29, 2025
@danhellem danhellem linked an issue Jul 29, 2025 that may be closed by this pull request
@danhellem danhellem added the Waiting for Merge 🚘 waiting for pull request to merge label Jul 29, 2025
@danhellem danhellem requested a review from Copilot July 30, 2025 00:05
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds transformation logic to the get_work_items_batch_by_ids tool to simplify the System.AssignedTo field response. Instead of returning the complete identity object with multiple properties, it now returns a formatted string containing the display name and email in the format "Name ".

Key Changes

  • Added System.AssignedTo to the fields array for the batch work items API call
  • Implemented transformation logic to convert AssignedTo objects to formatted strings
  • Added comprehensive test coverage for various AssignedTo scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/tools/workitems.ts Added System.AssignedTo field to query and transformation logic to format identity objects as "Name " strings
test/src/tools/workitems.test.ts Added comprehensive test cases covering various AssignedTo field scenarios including complete objects, partial data, strings, and missing fields
Comments suppressed due to low confidence (2)

test/src/tools/workitems.test.ts:383

  • [nitpick] This test expects 'John Doe <>' as output when uniqueName is missing, but this format with empty angle brackets may not be user-friendly. Consider testing for a more meaningful format like just 'John Doe' when email is unavailable.
      expect(resultData[0].fields["System.AssignedTo"]).toBe("John Doe <>");

test/src/tools/workitems.test.ts:419

  • [nitpick] This test expects '[email protected]' when displayName is missing, which may not be the most user-friendly format. Consider testing for just the email address without angle brackets when displayName is unavailable.
      expect(resultData[0].fields["System.AssignedTo"]).toBe("<[email protected]>");

@danhellem danhellem merged commit 44c8428 into main Jul 30, 2025
7 checks passed
@danhellem danhellem deleted the users/danhellem/get-by-ids-assigned-to-1 branch July 30, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting for Merge 🚘 waiting for pull request to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add System.AssignedTo field to wit_get_work_items_batch_by_ids query

2 participants