コード例 #1
0
ファイル: Program.cs プロジェクト: sankar1211/VisibleAgile
        static void Main(string[] args)
        {
            Console.WriteLine("Hello and welcome to a Jira Example application!");

            Console.Write("Enter Base URL <Default: https://visibleagile.atlassian.net/> :");
            string baseUrl = Console.ReadLine();

            if (baseUrl.Trim().Length == 0)
            {
                baseUrl = "https://visibleagile.atlassian.net/";
            }

            #region Create manager
            Console.Write("Username: <Default: [email protected]>");
            string username = Console.ReadLine();

            if (username.Trim().Length == 0)
            {
                username = "******";
            }

            Console.Write("Password: "******"*****@*****.**") == true)
            {
                password = "******";
            }

            JiraManager manager = new JiraManager(baseUrl, username, password);
            #endregion

            Console.Clear();

            // Get List of Boards
            BoardsDescription bd     = manager.GetBoards(baseUrl);
            List <BoardsData> boards = bd.Values;

            if (boards.Count == 0)
            {
                Console.WriteLine("No Boards created yet");
                return;
            }

            Console.WriteLine("Select a Board: ");

            for (int i = 0; i < boards.Count; i++)
            {
                Console.WriteLine("{0}: {1}", i, boards[i].Name);
            }

            Console.Write("Boards to open: ");

            string boardsStringIndex = Console.ReadLine();
            int    boardIndex        = 0;
            if (!int.TryParse(boardsStringIndex, out boardIndex))
            {
                Console.WriteLine("You failed to select a board...");
                Environment.Exit(0);
            }

            BoardsData selectedBoard = boards[boardIndex];

            if (selectedBoard.Type.Equals("scrum"))
            {
                SprintsDescription sprintsDescription = manager.GetSprints(selectedBoard.Id);

                List <SprintData> sprints = sprintsDescription.Values;

                if (sprints.Count != 0)
                {
                    for (int i = 0; i < sprints.Count; i++)
                    {
                        int numIssues = manager.GetNumIssues(selectedBoard.Id, sprints[i].Id);
                        Console.WriteLine("Number of issues in Sprint " + sprints[i].Id + ": " + sprints[i].Name + " are " + numIssues);
                    }
                }
                else
                {
                    Console.WriteLine("No Sprints created yet");
                }
            }
            else
            {
                Console.WriteLine("Does Not support Non-scrum");
            }
            Console.Read();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello and welcome to a Jira Example application!");

            Console.Write("Enter Base URL <Default: https://visibleagile.atlassian.net/rest/api/latest/");
            string baseUrl = Console.ReadLine();

            if (baseUrl.Trim().Length == 0)
            {
                baseUrl = "https://visibleagile.atlassian.net/rest/api/latest/";
            }

            #region Create manager
            Console.Write("Username: "******"Password: "******"Select a project: ");
            for (int i = 0; i < projects.Count; i++)
            {
                Console.WriteLine("{0}: {1}", i, projects[i].Name);
            }

            Console.Write("Project to open: ");
            string projectStringIndex = Console.ReadLine();
            int    projectIndex       = 0;
            if (!int.TryParse(projectStringIndex, out projectIndex))
            {
                Console.WriteLine("You failed to select a project...");
                Environment.Exit(0);
            }

            ProjectDescription selectedProject = projects[projectIndex];
            string             projectKey      = selectedProject.Key;

            string       jql = "project = " + projectKey;
            List <Issue> issueDescriptions = manager.GetIssues(jql);
            string       name = "";
            foreach (Issue description in issueDescriptions)
            {
                if (description.Fields.Assignee == null)
                {
                    name = "Not Assigned";
                }
                else
                {
                    name = description.Fields.Assignee.DisplayName;
                }

                Console.WriteLine("{0}: {1}: {2}", description.Key, description.Fields.Summary, name);
            }



            Console.Read();
        }