언급 된 스타 인처럼 작업 항목 링크를 업데이트하여 작업 항목을 끌어 오기 요청에 연결할 수 있습니다. 당신이 사용하는 코드 언어
확실하지, 난 당신의 참조를 위해 C# 코드 샘플을 추가 :
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.SourceControl.WebApi;
using Microsoft.TeamFoundation.WorkItemTracking.WebApi;
using Microsoft.VisualStudio.Services.WebApi.Patch.Json;
using Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models;
namespace PRWIl
{
class Program
{
static void Main(string[] args)
{
string tfsurl = "https://xxx.visualstudio.com/";
TfsTeamProjectCollection ttpc = new TfsTeamProjectCollection(new Uri(tfsurl));
GitHttpClient ghc = ttpc.GetClient<GitHttpClient>();
string project = "ProjectName";
string repoid = "repositoryid";
int pullrequestid = 1;
int workitemid = 1;
GitPullRequest gpr = ghc.GetPullRequestAsync(project,repoid,pullrequestid).Result;
WorkItemTrackingHttpClient withc = ttpc.GetClient<WorkItemTrackingHttpClient>();
JsonPatchDocument json = new JsonPatchDocument();
string pullrequesturl = "vstfs:///Git/PullRequestId/" + gpr.Repository.ProjectReference.Id + "%2F" + gpr.Repository.Id + "%2F" + gpr.PullRequestId;
json.Add(new JsonPatchOperation
{
Operation = Microsoft.VisualStudio.Services.WebApi.Patch.Operation.Add,
Path = "/relations/-",
Value = new WorkItemRelation() {Rel = "ArtifactLink", Url = pullrequesturl }
});
WorkItem result = withc.UpdateWorkItemAsync(json,workitemid).Result;
}
}
}
당신이 성공 항목을 작동하거나 사용자의 음성을 투표를 풀 요청을 연결합니까? –
현재로서는 프로그램 방식으로 보이지 않으므로이 문제에 대해 투표했습니다. –