Skip to content

Commit a607959

Browse files
authored
chore: work-items.ts to increase char check for markdown format (#1167)
This pull request makes a minor adjustment to the logic for handling Markdown-formatted fields in work item updates. The threshold for considering a field as Markdown based on its value length has been increased from 50 to 100 characters, making the detection less aggressive. ## GitHub issue number N/A ## **Associated Risks** None ## ✅ **PR Checklist** - [x] **I have read the [contribution guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CONTRIBUTING.md)** - [x] **I have read the [code of conduct guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CODE_OF_CONDUCT.md)** - [x] Title of the pull request is clear and informative. - [x] 👌 Code hygiene - [x] 🔭 Telemetry added, updated, or N/A - [x] 📄 Documentation added, updated, or N/A - [x] 🛡️ Automated tests added, or N/A ## 🧪 **How did you test it?** manual tests. re-ran auto tests
1 parent d9b2513 commit a607959

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools/work-items.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -903,9 +903,9 @@ function configureWorkItemTools(server: McpServer, tokenProvider: () => Promise<
903903

904904
// Check if any field has format === "Markdown" and add the multilineFieldsFormat operation
905905
// this should only happen for large text fields, but since we dont't know by field name, lets assume if the users
906-
// passes a value longer than 50 characters, then we can set the format to Markdown
906+
// passes a value longer than 100 characters, then we can set the format to Markdown
907907
fields.forEach(({ name, value, format }) => {
908-
if (value.length > 50 && format === "Markdown") {
908+
if (value.length > 100 && format === "Markdown") {
909909
document.push({
910910
op: "add",
911911
path: `/multilineFieldsFormat/${name}`,
@@ -1055,7 +1055,7 @@ function configureWorkItemTools(server: McpServer, tokenProvider: () => Promise<
10551055

10561056
// Add format operations for Markdown fields
10571057
workItemUpdates.forEach(({ path, value, format }) => {
1058-
if (format === "Markdown" && value && value.length > 50) {
1058+
if (format === "Markdown" && value && value.length > 100) {
10591059
operations.push({
10601060
op: "Add",
10611061
path: `/multilineFieldsFormat${path.replace("/fields", "")}`,

0 commit comments

Comments
 (0)