targetprocess-mcp-server 2.2.5 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,8 +56,13 @@ Cards — Read
56
56
 
57
57
  Cards — Write
58
58
  - `add_comment` — Post a comment to any card (id, comment)
59
- - `create_bug` — Create a standalone bug (title, bugContent, optional origin, optional projectId, optional teamId, optional entityStateId)
59
+ - `update_bug` — Update an existing bug (id, optional title, optional bugContent, optional origin, optional projectId, optional teamId, optional entityStateId)
60
+ > Resolve state name → ID via `get_bug_workflows` before passing `entityStateId`
61
+ - `update_user_story` — Update an existing user story (id, optional title, optional description, optional projectId, optional teamId, optional entityStateId)
62
+ > Resolve state name → ID via `get_user_story_workflows` before passing `entityStateId`
63
+ - `create_bug` — Create a standalone bug (title, bugContent, optional origin, optional projectId, optional teamId, optional entityStateName)
60
64
  > `origin` accepted values: `Production - Customer`, `Production - Internal`, `Pre-Release - Customer`, `Pre-Release - Internal`, `Regression - Dev01`, `Regression - Team Env`, `Manual QA` *(default)*, `Developer Raised`, `Operations`
65
+ > `entityStateName` accepted values: `Backlog`, `In Triage`, `Ready for Dev`, `In Dev`, `Blocked`, `PR Raised`, `Ready for Feature PCH`, `Ready for Feature QA`, `In Feature QA`, `Failed Feature QA`, `Ready for Merge`, `Ready to Deploy to Dev01`, `Ready for Dev01 QA`, `In Dev01 QA`, `Failed Dev01 QA`, `Ready to Deploy to prod`, `Closed`
61
66
  > [!NOTE]
62
67
  > `projectId` and `teamId` are optional — fall back to `TP_PROJECT_ID` and `TP_TEAM_ID` from config
63
68
  - `create_bug_based_on_card` — Create a bug linked to an existing user story or bug card (card object with id+type, title, bugContent, optional origin, optional projectId, optional teamId)
@@ -77,9 +82,11 @@ Test Case Workflows
77
82
  - `write_test_cases` — Fetch a card (UserStory, Bug, or Feature) by ID and trigger the full test case writing workflow: Claude analyzes the card, generates detailed test cases covering happy path, edge cases, and error scenarios, creates a linked test plan via `create_test_plan`, then calls `add_test_cases_to_test_plan`. Each test case description contains Preconditions and Test Type as HTML; steps are passed as a structured array (resourceId, optional resourceType)
78
83
  - `add_test_cases_to_test_plan` — Add pre-generated test cases to an existing test plan. Each test case has a `name`, an HTML `description` (Preconditions and Test Type only), and a `steps` array of `{ description, result }` objects — steps are created via the TP test step API rather than embedded in the description (testPlanId, testCases array of {name, description, steps})
79
84
 
80
- Processes
85
+ Processes & Workflows
81
86
  - `get_processes` — Get all Targetprocess processes (no params needed)
82
87
  - `get_process_workflows` — Get workflows for a specific process (processId)
88
+ - `get_bug_workflows` — Get all bug entity states/workflows for the configured process (no params needed)
89
+ - `get_user_story_workflows` — Get all user story entity states/workflows for the configured process (no params needed)
83
90
 
84
91
  Projects
85
92
  - `get_projects` — Get all Targetprocess projects (no params needed)
package/build/config.js CHANGED
@@ -6,7 +6,7 @@ export const config = {
6
6
  ownerId: process.env.TP_OWNER_ID || "1504",
7
7
  projectId: process.env.TP_PROJECT_ID || "",
8
8
  teamId: process.env.TP_TEAM_ID || "",
9
- processId: process.env.TP_PROCESS_ID || "",
9
+ processId: process.env.TP_PROCESS_ID || "89",
10
10
  userStoryWorkflowId: process.env.TP_USER_STORY_WORKFLOW_ID || "",
11
11
  bugWorkflowId: process.env.TP_BUG_WORKFLOW_ID || "",
12
12
  }
package/build/index.js CHANGED
@@ -661,6 +661,111 @@ server.registerTool('create_bug_based_on_card', {
661
661
  }],
662
662
  };
663
663
  });
664
+ server.registerTool('update_bug', {
665
+ title: 'Update a bug card',
666
+ description: `Update a bug card with data proded from user input.
667
+ NOTE: pass only the fields that user wants to update.
668
+ CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
669
+ 1) IF the user specified a team by name (not ID), call "get_teams" to find the matching team and use its ID as teamId;
670
+ 2) IF the user specified a project by name (not ID), call "get_projects" to find the matching project and use its ID as projectId;
671
+ 3) IF the user specified a state by name (not ID), call "get_bug_workflows" to find the matching state and use its ID as entityStateId;`,
672
+ inputSchema: {
673
+ id: z.string()
674
+ .min(5)
675
+ .max(6)
676
+ .describe('Bug card ID (e.g. 145789)'),
677
+ title: z.string()
678
+ .optional()
679
+ .describe('Bug card title that summarizes the problem in concise, descriptive, and actionable manner, enabling a developer to understand the issue without opening the report'),
680
+ bugContent: z.string()
681
+ .optional()
682
+ .describe(`Bug description content, explain what happened in detail. Include expected behaviour and what actually occurred. Be specific and avoid assumptions. Clearly outline the actions needed to trigger the bug. Number each step so anyone can follow them easily`),
683
+ origin: z.enum([
684
+ "Production - Customer",
685
+ "Production - Internal",
686
+ "Pre-Release - Customer",
687
+ "Pre-Release - Internal",
688
+ "Regression - Dev01",
689
+ "Regression - Team Env",
690
+ "Manual QA",
691
+ "Developer Raised",
692
+ "Operations",
693
+ ])
694
+ .optional()
695
+ .describe('Where the bug was found, defaults to "Manual QA"'),
696
+ projectId: z.string()
697
+ .optional()
698
+ .describe('Optional Project ID — if user gave a project name, resolve it via "get_projects" first; defaults to TP_PROJECT_ID from config'),
699
+ teamId: z.string()
700
+ .optional()
701
+ .describe('Optional Team ID — if user gave a team name, resolve it via "get_teams" first; defaults to TP_TEAM_ID from config'),
702
+ entityStateId: z.string()
703
+ .optional()
704
+ .describe('Optional Entity State ID — if user gave a state name, resolve it via "get_bug_workflows" first; defaults to "Done"'),
705
+ },
706
+ }, async ({ id, title, bugContent, origin, projectId, teamId, entityStateId }) => {
707
+ const bugResponse = await tp.updateBug({ id, title, bugContent, origin, projectId, teamId, entityStateId });
708
+ if (!bugResponse) {
709
+ return {
710
+ content: [{
711
+ type: 'text',
712
+ text: `Failed to update bug "${title}"\n JSON: ${JSON.stringify(bugResponse, null, 2)}`
713
+ }]
714
+ };
715
+ }
716
+ return {
717
+ content: [{
718
+ type: 'text',
719
+ text: JSON.stringify(bugResponse)
720
+ }],
721
+ };
722
+ });
723
+ server.registerTool('update_user_story', {
724
+ title: 'Update a user story card',
725
+ description: `Update a user story card with data provided from user input.
726
+ NOTE: pass only the fields that user wants to update.
727
+ CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
728
+ 1) IF the user specified a team by name (not ID), call "get_teams" to find the matching team and use its ID as teamId;
729
+ 2) IF the user specified a project by name (not ID), call "get_projects" to find the matching project and use its ID as projectId;
730
+ 3) IF the user specified a state by name (not ID), call "get_user_story_workflows" to find the matching state and use its ID as entityStateId;`,
731
+ inputSchema: {
732
+ id: z.string()
733
+ .min(5)
734
+ .max(6)
735
+ .describe('User story card ID (e.g. 145789)'),
736
+ title: z.string()
737
+ .optional()
738
+ .describe('Updated user story title'),
739
+ description: z.string()
740
+ .optional()
741
+ .describe('Updated user story description (format as HTML)'),
742
+ projectId: z.string()
743
+ .optional()
744
+ .describe('Optional Project ID — if user gave a project name, resolve it via "get_projects" first'),
745
+ teamId: z.string()
746
+ .optional()
747
+ .describe('Optional Team ID — if user gave a team name, resolve it via "get_teams" first'),
748
+ entityStateId: z.string()
749
+ .optional()
750
+ .describe('Optional Entity State ID — if user gave a state name, resolve it via "get_user_story_workflows" first'),
751
+ },
752
+ }, async ({ id, title, description, projectId, teamId, entityStateId }) => {
753
+ const response = await tp.updateUserStory({ id, title, description, projectId, teamId, entityStateId });
754
+ if (!response) {
755
+ return {
756
+ content: [{
757
+ type: 'text',
758
+ text: `Failed to update user story id: ${id}\n JSON: ${JSON.stringify(response, null, 2)}`
759
+ }]
760
+ };
761
+ }
762
+ return {
763
+ content: [{
764
+ type: 'text',
765
+ text: JSON.stringify(response)
766
+ }],
767
+ };
768
+ });
664
769
  server.registerTool('create_bug', {
665
770
  title: 'Create a new bug card',
666
771
  description: `Create a new bug card that summarizes the problem in concise, descriptive manner answering questions "What? Where? When?" and content explaining what happened in detail.
@@ -694,9 +799,12 @@ server.registerTool('create_bug', {
694
799
  teamId: z.string()
695
800
  .optional()
696
801
  .describe('Optional Team ID — if user gave a team name, resolve it via "get_teams" first; defaults to TP_TEAM_ID from config'),
802
+ entityStateId: z.string()
803
+ .optional()
804
+ .describe('Optional Entity State ID — if user gave a state name, resolve it via "get_bug_workflows" first; defaults to "Done"'),
697
805
  },
698
- }, async ({ title, bugContent, origin, projectId, teamId }) => {
699
- const bugResponse = await tp.createBugOnly({ title, bugContent, origin, projectId, teamId });
806
+ }, async ({ title, bugContent, origin, projectId, teamId, entityStateId }) => {
807
+ const bugResponse = await tp.createBugOnly({ title, bugContent, origin, projectId, teamId, entityStateId });
700
808
  if (!bugResponse) {
701
809
  return {
702
810
  content: [{
@@ -1306,6 +1414,84 @@ server.registerTool('get_processes', {
1306
1414
  }],
1307
1415
  };
1308
1416
  });
1417
+ server.registerTool('get_bug_workflows', {
1418
+ title: 'Get bug workflows',
1419
+ description: 'Get all Targetprocess bug workflows',
1420
+ }, async ({}) => {
1421
+ const response = await tp.getBugWorkflows();
1422
+ if (!response) {
1423
+ return {
1424
+ content: [{
1425
+ type: 'text',
1426
+ text: `Failed to get bug entity statuses, JSON: ${JSON.stringify(response, null, 2)}`
1427
+ }],
1428
+ };
1429
+ }
1430
+ const items = response.items || [];
1431
+ if (items.length === 0) {
1432
+ return {
1433
+ content: [{
1434
+ type: 'text',
1435
+ text: `No status data found for workflows`
1436
+ }],
1437
+ };
1438
+ }
1439
+ const workflows = items.map((w) => ({
1440
+ id: w.id,
1441
+ name: w.name,
1442
+ processId: w.process,
1443
+ entityType: w.entityType,
1444
+ entityStates: w.entityStates.map((es) => ({
1445
+ id: es.id,
1446
+ name: es.name,
1447
+ })),
1448
+ }));
1449
+ return {
1450
+ content: [{
1451
+ type: 'text',
1452
+ text: JSON.stringify(workflows)
1453
+ }],
1454
+ };
1455
+ });
1456
+ server.registerTool('get_user_story_workflows', {
1457
+ title: 'Get User Story workflows',
1458
+ description: 'Get all Targetprocess user story workflows',
1459
+ }, async ({}) => {
1460
+ const response = await tp.getUserStoryWorkflows();
1461
+ if (!response) {
1462
+ return {
1463
+ content: [{
1464
+ type: 'text',
1465
+ text: `Failed to get user story entity statuses, JSON: ${JSON.stringify(response, null, 2)}`
1466
+ }],
1467
+ };
1468
+ }
1469
+ const items = response.items || [];
1470
+ if (items.length === 0) {
1471
+ return {
1472
+ content: [{
1473
+ type: 'text',
1474
+ text: `No status data found for workflows`
1475
+ }],
1476
+ };
1477
+ }
1478
+ const workflows = items.map((w) => ({
1479
+ id: w.id,
1480
+ name: w.name,
1481
+ processId: w.process,
1482
+ entityType: w.entityType,
1483
+ entityStates: w.entityStates.map((es) => ({
1484
+ id: es.id,
1485
+ name: es.name,
1486
+ })),
1487
+ }));
1488
+ return {
1489
+ content: [{
1490
+ type: 'text',
1491
+ text: JSON.stringify(workflows)
1492
+ }],
1493
+ };
1494
+ });
1309
1495
  server.registerTool('get_card_current_status', {
1310
1496
  title: 'Get card status',
1311
1497
  description: 'Get the EntityState, TeamState, and assigned teams for a TP card (UserStory, Bug, or Feature) by ID',
package/build/tp.js CHANGED
@@ -130,31 +130,51 @@ export class TpClient {
130
130
  param: { "format": "json" },
131
131
  }, bug);
132
132
  }
133
- async updateUserStory({ title, description, projectId, teamId }) {
134
- const userStory = {
135
- "Name": title,
136
- "Description": description,
137
- "Project": {
138
- "Id": projectId || config.tp.projectId
139
- },
140
- "assignedTeams": [
141
- {
142
- "entityState": {
143
- "id": 7407
144
- },
145
- "id": 84252,
133
+ async updateUserStory({ id, title, description, projectId, teamId, entityStateId }) {
134
+ const userStory = { "Id": id };
135
+ if (title)
136
+ userStory["Name"] = title;
137
+ if (description)
138
+ userStory["Description"] = description;
139
+ if (projectId)
140
+ userStory["Project"] = { "Id": projectId };
141
+ if (teamId)
142
+ userStory["assignedTeams"] = [{ "team": { "id": teamId } }];
143
+ if (entityStateId)
144
+ userStory["EntityState"] = { "Id": entityStateId };
145
+ return this.post({
146
+ pathParam: ["UserStories"],
147
+ param: { "format": "json" },
148
+ }, userStory);
149
+ }
150
+ async updateBug({ id, title, bugContent, origin, projectId, teamId, entityStateId }) {
151
+ const bug = { "Id": id };
152
+ if (title)
153
+ bug["Name"] = title;
154
+ if (bugContent)
155
+ bug["Description"] = bugContent;
156
+ if (origin)
157
+ bug["customFields"] = [{
158
+ "name": "Origin",
159
+ "type": "DropDown",
160
+ "value": origin
161
+ }];
162
+ if (projectId)
163
+ bug["Project"] = { "Id": projectId };
164
+ if (teamId)
165
+ bug["assignedTeams"] = [{
146
166
  "team": {
147
167
  "id": teamId || config.tp.teamId
148
168
  }
149
- }
150
- ]
151
- };
169
+ }];
170
+ if (entityStateId)
171
+ bug["entityState"] = { "id": entityStateId };
152
172
  return this.post({
153
- pathParam: ["UserStories"],
173
+ pathParam: ["bugs"],
154
174
  param: { "format": "json" },
155
- }, userStory);
175
+ }, bug);
156
176
  }
157
- async createBugOnly({ title, bugContent, origin = "Manual QA", projectId, teamId }) {
177
+ async createBugOnly({ title, bugContent, origin = "Manual QA", projectId, teamId, entityStateId }) {
158
178
  const bug = {
159
179
  "Name": title,
160
180
  "Project": {
@@ -172,6 +192,8 @@ export class TpClient {
172
192
  }],
173
193
  "Description": bugContent,
174
194
  };
195
+ if (entityStateId)
196
+ bug["EntityState"] = { "Id": entityStateId };
175
197
  return this.post({
176
198
  pathParam: ["bugs"],
177
199
  param: { "format": "json" },
@@ -517,6 +539,30 @@ export class TpClient {
517
539
  param: { "format": "json" },
518
540
  });
519
541
  }
542
+ async getUserStoryWorkflows() {
543
+ return this.get({
544
+ pathParam: ["workflow"],
545
+ param: {
546
+ "format": "json",
547
+ "select": `{Id,Name,Process,EntityType,EntityStates.Select({Id,Name}) as EntityStates}`,
548
+ "where": `(process.id=${config.tp.processId} and entityType.name="userStory" and parentWorkflow=null)`,
549
+ "take": "1",
550
+ },
551
+ apiVersion: this.v2
552
+ });
553
+ }
554
+ async getBugWorkflows() {
555
+ return this.get({
556
+ pathParam: ["workflow"],
557
+ param: {
558
+ "format": "json",
559
+ "select": `{Id,Name,Process,EntityType,EntityStates.Select({Id,Name}) as EntityStates}`,
560
+ "where": `(process.id=${config.tp.processId} and entityType.name="bug" and parentWorkflow=null)`,
561
+ "take": "1",
562
+ },
563
+ apiVersion: this.v2
564
+ });
565
+ }
520
566
  async getCardStatus(cardId, resourceType = 'UserStory') {
521
567
  const pathMap = { UserStory: 'userStory', Bug: 'bug', Feature: 'feature' };
522
568
  return this.get({
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "engines": {
26
26
  "node": ">=20.x"
27
27
  },
28
- "version": "2.2.5",
28
+ "version": "2.2.6",
29
29
  "description": "MCP server for Tartget Process",
30
30
  "main": "build/index.js",
31
31
  "keywords": [