Example Title |
Copy Code
|
---|---|
public void SetGetReleases() { /* Set target releases for requirement To set Target Cycles to Requirement, use requirement field RQ_TARGET_RCYC. */ ReqFactory rFactory; Req requirement; List outlistOfReleases, listOfReleases; long requirementId; StringBuilder strReleasesNames = new StringBuilder(); //listOfReleases can be a list of release IDs or a list of Release objects. listOfReleases = new List(); listOfReleases.Add(2); listOfReleases.Add(3); listOfReleases.Add(4); //For Example: You can attach the release like this. /* ReleaseFactory relF = (ReleaseFactory) tdConnection.ReleaseFactory; listOfReleases = relF.NewList(""); */ requirementId = 9; rFactory = (ReqFactory)tdConnection.ReqFactory; requirement = rFactory[requirementId]; //Set the target releases of this requirement. requirement["RQ_TARGET_REL"] = listOfReleases; requirement.Post(); //Retrieve the releases. outlistOfReleases = requirement["RQ_TARGET_REL"]; strReleasesNames.Append("Releases are: "); foreach (Release rel in outlistOfReleases) { strReleasesNames.Append(rel.Name + ", "); } MessageBox.Show(strReleasesNames.ToString()); } |