Свяжите требование с выпуском в ALm, используя C # - PullRequest
0 голосов
/ 11 октября 2018

Я хочу связать требование с выпуском в ALm, используя C #.

Я пробовал этот код, но получаю ошибку.Сначала я прочитал старый релиз, затем попытался скопировать его, но у меня появляется ошибка.

foreach (Release rl in listRel)
if (rl.Name == ReleasetreeView.SelectedNode.Name)
{

NewORL = rl;
sif = NewORL.ScopeItemFactory;
altsif = ORL.ScopeItemFactory;

NewORL.Post();

foreach (ScopeItem si in altsif.NewList(""))
{

RMSI = sif.AddItem(System.DBNull.Value);
RMSI.Name = si.Name;
RMSI.Priority = si.Priority;
RMSI.AutoPost = si.AutoPost;
RMSI.Description = si.Description;
RMSI.Post();
CDF = RMSI.ContentDefinitionFactory;
altCDF = si.ContentDefinitionFactory;
ContentPartFactory cpf,ncpf;
ContentRootFactory crf,ncrf;

foreach (ContentDefinition CD in altCDF.NewList(""))
{
string s=CD.Name;
cpf = CD.ContentPartFactory;

crf = CD.ContentRootFactory;
ncrf = CD.ContentRootFactory;
foreach (ContentRoot CR in crf.NewList(""))
{


ContentRoot = ncrf.AddItem(System.DBNull.Value);
ContentRoot.Name = CR.Name;
ContentRoot.RootEntityId = CR.RootEntityId;
ContentRoot.RootEntityType = CR.RootEntityType;


 ContentRoot.Post();


}

Не могли бы вы мне помочь?

1 Ответ

0 голосов
/ 17 октября 2018

я нашла своего фехлера

 //Copy New ContentDefinition from selected ContentDefinition
            var CDF = RMSI.ContentDefinitionFactory;
            var altCDF = si.ContentDefinitionFactory;

            foreach (ContentDefinition CD in altCDF.NewList(""))
            {
                CDFF= CDF.AddItem(System.DBNull.Value);
                CDFF.Name = CD.Name;
                CDFF.AutoCompleteType = CD.AutoCompleteType;
                CDFF.Post();

                //Copy New ContentRoot from selected ContentRoot
                //ContentRoot is requirement
                var crf = CD.ContentRootFactory;
                var ncrf = CDFF.ContentRootFactory;


                foreach (ContentRoot CR in crf.NewList(""))
                {

                    //Add associate a requirement
                    var ContentRoot = ncrf.AddItem(System.DBNull.Value);
                    ContentRoot.Name = CR.Name;
                    ContentRoot.RootEntityId = CR.RootEntityId;
                    ContentRoot.RootEntityType = CR.RootEntityType;
                    ContentRoot.Post();



                }
            }
...