Пример #1
0
        public override TCObject Execute(TCObject objectToExecuteOn, TCAddOnTaskContext taskContext)
        {
            if (objectToExecuteOn is TCFolder)
            {
                AddExecutionEntries(objectToExecuteOn as TCFolder);
            }

            if (objectToExecuteOn is ExecutionEntryFolder)
            {
                AddExecutionEntries(objectToExecuteOn as ExecutionEntryFolder);
            }

            if (objectToExecuteOn is ExecutionList)
            {
                AddExecutionEntries(objectToExecuteOn as ExecutionList);
            }
            TFSConnector tfs = new TFSConnector();
            foreach (ExecutionEntry ee in entries)
            {
                if (IsInteger(ee.ActualLog.ChangeRequestId))
                {
                    DefectResult dr = tfs.GetDefect(ee.ActualLog.ChangeRequestId);
                    ee.ActualLog.ChangeRequestState = dr.status;
                }
            }
            tfs.GetTFSDefectsWithToscaDefects();
            tfs.DisposeTFS();
            return null;
        }
Пример #2
0
        public override TCObject Execute(TCObject objectToExecuteOn, TCAddOnTaskContext taskContext)
        {
            if (objectToExecuteOn is TCFolder)
            {
                AddExecutionEntries(objectToExecuteOn as TCFolder);
            }

            if (objectToExecuteOn is ExecutionEntryFolder)
            {
                AddExecutionEntries(objectToExecuteOn as ExecutionEntryFolder);
            }

            if (objectToExecuteOn is ExecutionList)
            {
                AddExecutionEntries(objectToExecuteOn as ExecutionList);
            }
            TFSConnector tfs = new TFSConnector();
            List<Defect> TFSDefects = tfs.GetTFSDefectsWithToscaDefects();
            foreach (ExecutionEntry ee in entries)
            {
                if (IsInteger(ee.ActualLog.ChangeRequestId))
                {
                    DefectResult dr = tfs.GetDefect(ee.ActualLog.ChangeRequestId);
                    ee.ActualLog.ChangeRequestState = dr.status;
                }
                else
                {
                    Defect defect = TFSDefects.Find(d => d.uniqueid == ee.UniqueId);
                    if (defect != null)
                    {
                        ee.ActualLog.ChangeRequestState = defect.status;
                        ee.ActualLog.ChangeRequestId = defect.id.ToString();
                    }
                }
            }

            tfs.DisposeTFS();
            return null;
        }