Beispiel #1
0
        private List <ALMRequirement> ExtractRequirements(dynamic data, out int?totalResults)
        {
            List <ALMRequirement> requirementsList = new List <ALMRequirement>();
            bool convertationResult = false;

            dynamic entities = DictionaryExtension.TryGetValue(data, "entities", out convertationResult);

            if (entities != null)
            {
                for (int i = 0; i < entities.Length; i++)
                {
                    ALMRequirement requirement = new ALMRequirement();
                    dynamic        fields      = DictionaryExtension.TryGetValue(entities[i], "Fields", out convertationResult);

                    if (fields != null)
                    {
                        for (int j = 0; j < fields.Length; j++)
                        {
                            dynamic someName  = DictionaryExtension.TryGetValue(fields[j], "Name", out convertationResult);
                            dynamic someValue = DictionaryExtension.TryGetValue(fields[j], "values", out convertationResult);

                            if ((someName != null) && (someValue != null))
                            {
                                if (someValue.Length > 0)
                                {
                                    if (someName.Equals("id"))
                                    {
                                        requirement.id = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("parent-id"))
                                    {
                                        requirement.parent_id = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("name"))
                                    {
                                        requirement.name = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("father-name"))
                                    {
                                        requirement.father_name = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("req-priority"))
                                    {
                                        requirement.req_priority = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-90"))
                                    {
                                        requirement.user_90_sprint = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-06"))
                                    {
                                        requirement.user_06_status = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("req-status"))
                                    {
                                        requirement.req_status = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-27"))
                                    {
                                        requirement.user_27_qa_lead = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-08"))
                                    {
                                        requirement.user_08_dev_team = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-17"))
                                    {
                                        requirement.user_17_dev_lead = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("owner"))
                                    {
                                        requirement.owner_author = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-37"))
                                    {
                                        requirement.user_37_qa_effort = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-28"))
                                    {
                                        requirement.user_28_dev_effort = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-38"))
                                    {
                                        requirement.user_38_FA = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-41"))
                                    {
                                        requirement.user_41_FA_notes = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-66"))
                                    {
                                        requirement.user_66_back_to_dev_count = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("last-modified"))
                                    {
                                        requirement.last_modified_date = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("req-ver-stamp"))
                                    {
                                        requirement.req_ver_stamp = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-97"))
                                    {
                                        requirement.user_97_theme = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                }
                            }
                        }
                    }
                    requirementsList.Add(requirement);
                }
            }

            totalResults = DictionaryExtension.TryGetValue(data, "TotalResults", out convertationResult);
            return(requirementsList);
        }
Beispiel #2
0
        private List <ALMDefect> ExtractDefects(dynamic data, out int?totalResults)
        {
            List <ALMDefect> defectsList        = new List <ALMDefect>();
            bool             convertationResult = false;

            dynamic entities = DictionaryExtension.TryGetValue(data, "entities", out convertationResult);

            if (entities != null)
            {
                for (int i = 0; i < entities.Length; i++)
                {
                    ALMDefect defect = new ALMDefect();
                    dynamic   fields = DictionaryExtension.TryGetValue(entities[i], "Fields", out convertationResult);

                    if (fields != null)
                    {
                        for (int j = 0; j < fields.Length; j++)
                        {
                            dynamic someName  = DictionaryExtension.TryGetValue(fields[j], "Name", out convertationResult);
                            dynamic someValue = DictionaryExtension.TryGetValue(fields[j], "values", out convertationResult);

                            if ((someName != null) && (someValue != null))
                            {
                                if (someValue.Length > 0)
                                {
                                    if (someName.Equals("product"))
                                    {
                                        defect.product = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("version"))
                                    {
                                        defect.version = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("id"))
                                    {
                                        defect.id = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("name"))
                                    {
                                        defect.name = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("priority"))
                                    {
                                        defect.priority = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("status"))
                                    {
                                        defect.status = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("detected-by"))
                                    {
                                        defect.detected_by = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("owner"))
                                    {
                                        defect.owner_dev = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-01"))
                                    {
                                        defect.user_01_productarea = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-04"))
                                    {
                                        defect.user_04_subarea = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-14"))
                                    {
                                        defect.user_14_devteam = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("user-40"))
                                    {
                                        defect.user_40_qalead = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("last-modified"))
                                    {
                                        defect.last_modified_date = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                    if (someName.Equals("planned-closing-ver"))
                                    {
                                        defect.planned_closing_ver = DictionaryExtension.TryGetString(someValue[0], "value", out convertationResult);
                                    }
                                }
                            }
                        }
                    }
                    defectsList.Add(defect);
                }
            }

            totalResults = DictionaryExtension.TryGetValue(data, "TotalResults", out convertationResult);
            return(defectsList);
        }