Example #1
0
    public override void Run()
    {
        WorkItemStore store = Driver.TeamFoundationServer.GetService(typeof(WorkItemStore)) as WorkItemStore;
        ILinking linking = Driver.TeamFoundationServer.GetService(typeof(ILinking)) as ILinking;
        int changeSet = 1;

        // Get URI for changeset
        ArtifactId changeSetId = new ArtifactId();
        changeSetId.Tool = "VersionControl";
        changeSetId.ArtifactType = "ChangeSet";
        changeSetId.ToolSpecificId = changeSet.ToString();
        string changeSetUri = LinkingUtilities.EncodeUri(changeSetId);

        // Get referencing artifacts for given changeset
        Artifact[] artifacts = linking.GetReferencingArtifacts(new string[] { changeSetUri }, null);

        foreach (Artifact artifact in artifacts)
            {
                Console.WriteLine(artifact.ToString());
                ArtifactId artifactId = LinkingUtilities.DecodeUri(artifact.Uri);
                if (String.Equals(artifactId.Tool, "WorkItemTracking", StringComparison.OrdinalIgnoreCase))
                    {
                        WorkItem wi = store.GetWorkItem(Convert.ToInt32(artifactId.ToolSpecificId));
                        Console.WriteLine(wi);
                    }
            }
    }
Example #2
0
 public static string EncodeUri(ArtifactId artifactId)
 {
     Console.WriteLine(artifactId);
     return "vstfs:///VersionControl/Changeset/1";
 }
Example #3
0
 public static string EncodeUri(ArtifactId artifactId)
 {
     Console.WriteLine(artifactId);
     return("vstfs:///VersionControl/Changeset/1");
 }