代码之家  ›  专栏  ›  技术社区  ›  Aswin Francis

Rally C#:我如何计算由定义的所有者所开发的版本下的功能数量?

  •  -1
  • Aswin Francis  · 技术社区  · 7 年前

    我正在从rally手动拉出以下报告

    随着(Q2-1)发布(当前)的进行

    o本版本的14个功能,其中4个由开发团队开发。1已完成。1阻止等待进一步信息。其余部分尚未分配/等待进一步发现

    随着(Q1-2)版本的发布(上一版本)

    o本版本中有12个特性,其中2个仍由开发团队开发,8个已完成。其余部分尚未分配/等待进一步发现

    o团队以13.5分的成绩完成了9个US和4个缺陷。4名美国选手被分到下一个sprint 8 DE

    我正在尝试使用一个控制台应用程序来实现自动化,该应用程序可以手动运行,也可以设置为每周运行的任务。我想知道以下几点:

    1. 如何获取我设置的发布值的功能计数?
    2. 如何获得开发人员使用的功能的数量?我通常通过检查这些功能是否有任何我们作为我的同事与所有者合作来实现这一点。
    3. 上述结果的状态?是否已完成、阻止或正在进行?
    4. 我或我在美国的同事所做的全部工作和缺陷,以及完成这些工作需要多少故事点

    我已经编写了进行身份验证的代码,目前正在发布所有工作

    2 回复  |  直到 7 年前
        1
  •  0
  •   jdweng    7 年前

    确保输入信息的人员一致。如果人工输入不一致,则此代码不会给出好的结果。

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;
    using System.Text.RegularExpressions;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            const string FILENAME = @"c:\temp\test.txt";
            static void Main(string[] args)
            {
                Report report =  new Report(FILENAME);
                report.Print();
                Console.ReadLine();
            }
        }
        public class Report
        {
            public static List<Report> reports = new List<Report>();
            public static int numberClosed { get; set; }
            public static int defects { get; set; }
            public static decimal points { get; set; }
    
            public string quarter { get; set; }
            public string release { get; set; }
            public int numberFeatures { get; set; }
            public int worked { get; set; }
            public int completed { get; set; }
    
            string patternWith = @"With the ongoing of \((?'quarter'[^\)]+)\) release \((?'release'[^\)]+)\)";
            string patternFeature = "features";
            string patternClose = "Team was able to close";
            string patternNumbers = @"\d+(.\d+)?";
    
            Match match = null;
            MatchCollection matches = null;
            public Report() { }
            public Report(string filename)
            {
    
                StreamReader reader = new StreamReader(filename);
    
    
                Report report = null;
    
                string inputLine = "";
                while((inputLine = reader.ReadLine()) != null)
                {
                    inputLine = inputLine.Trim();
                    if(inputLine.Length > 0)
                    {
                        match = Regex.Match(inputLine, patternWith);
                        if(match.Success)
                        {
                                report = new Report();
                                reports.Add(report);
                                report.quarter = match.Groups["quarter"].Value;
                                report.release = match.Groups["release"].Value;
                                continue;
                        }
                        match = Regex.Match(inputLine, patternFeature);
                        if (match.Success)
                        {
                            matches = Regex.Matches(inputLine, patternNumbers);
                            report.numberFeatures = int.Parse(matches[0].Value);
                            report.worked = int.Parse(matches[1].Value); 
                            report.completed  = int.Parse(matches[2].Value);
                            continue;
                        }
                        match = Regex.Match(inputLine, patternClose);
                        if (match.Success)
                        {
                            matches = Regex.Matches(inputLine, patternNumbers);
                            Report.numberClosed  = int.Parse(matches[0].Value);
                            Report.defects = int.Parse(matches[1].Value);
                            Report.points  = decimal.Parse(matches[2].Value);
    
    
                            break;
                        }
                    }
                }
                reader.Close();
            }
            public void Print()
            {
                Console.WriteLine("Summary : Reports = '{0}',  Closed = '{1}', Defects = '{2}', Points = '{3}'",
                    Report.reports.Count,
                    Report.numberClosed,
                    Report.defects,
                    Report.points);
    
                foreach (Report report in Report.reports)
                {
                    Console.WriteLine("Quarter : '{0}', Release : '{1}', Features : '{2}', Worked : '{3}', Completed : '{4}'",
                        report.quarter,
                        report.release,
                        report.numberFeatures,
                        report.worked,
                        report.completed);
                }
    
            }
    
        }
    }
    
        2
  •  0
  •   Aswin Francis    7 年前

    我写了一个超级糟糕的代码来完成这项工作。由于这只是我在业余时间试图做的事情,以自动化我正在做的手工工作,所以我没有花太多时间遵循标准。但这是可行的。下面的网站帮了我很多。它有一些可以帮助您起步的示例项目。

    https://github.com/nmusaelian-rally/rally-dot-net-rest-apps

    如果有人想知道我提出的问题的具体答案,请在这里发表评论,我一定会帮你的