Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/tools/repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function configureRepoTools(
title: z.string().describe("The title of the pull request."),
description: z.string().optional().describe("The description of the pull request. Optional."),
isDraft: z.boolean().optional().default(false).describe("Indicates whether the pull request is a draft. Defaults to false."),
workItems: z.string().optional().describe("Work item IDs to associate with the pull request, space-separated."),
},
async ({
repositoryId,
Expand All @@ -60,16 +61,22 @@ function configureRepoTools(
title,
description,
isDraft,
workItems,
}) => {
const connection = await connectionProvider();
const gitApi = await connection.getGitApi();
const workItemRefs = workItems
? workItems.split(" ").map((id) => ({ id: id.trim() }))
: [];

const pullRequest = await gitApi.createPullRequest(
{
sourceRefName,
targetRefName,
title,
description,
isDraft,
workItemRefs: workItemRefs,
},
repositoryId
);
Expand Down
Loading