コード例 #1
0
        private async Task <bool> TestLogin()
        {
            Atlassian.Jira.Jira tempJira = Atlassian.Jira.Jira.CreateRestClient(Setting.Value.Jira_Link, Username.Text, Password.Text, new JiraRestClientSettings()
            {
                EnableRequestTrace = true
            });

            bool pass = false;

            tempJira.Issues.MaxIssuesPerRequest = 5; //Set the Max Issues per Request to 25
            IPagedQueryResult <Issue> issues = null; //Creates a variable to store the issues in outside the try-catch statement

            try
            {
                issues = await tempJira.Issues.GetIssuesFromJqlAsync("project = LAC"); //Attempt to pull the issues

                if (issues.Count() == 5)
                {
                    pass = true;
                }
            }
            catch
            {
                pass = false;
            }

            return(pass);
        }
コード例 #2
0
        private async void LoadIssues(string jql)
        {
            infoLabel.ForeColor = Color.Black;
            infoLabel.Text      = "Loading";
            IPagedQueryResult <Issue> issues = null;

            try
            {
                if (StaticHandler._Main != null)
                {
                    StaticHandler._Main._Jira.Issues.MaxIssuesPerRequest = (int)maxIssuesPerRequest.Value;
                    issues = await StaticHandler._Main._Jira.Issues.GetIssuesFromJqlAsync(jql); //Attempt to pull the issues
                }
                if (StaticHandler._ThemedMain != null)
                {
                    JiraChecker._Jira.Issues.MaxIssuesPerRequest = (int)maxIssuesPerRequest.Value;
                    issues = await JiraChecker._Jira.Issues.GetIssuesFromJqlAsync(jql); //Attempt to pull the issues
                }
                infoLabel.Text      = "Loaded " + issues.Count <Issue>() + " issues";
                infoLabel.ForeColor = Color.Black;
                Issues.Clear();
                Issues.AddRange(issues);
                PopulateLists();
            }
            catch (Exception e)
            {
                infoLabel.Text = "Failed to load";
                MessageBox.Show(e.Message);
                infoLabel.ForeColor = Color.Red;
            }

            this.Size = new Size(461, 433);
        }
コード例 #3
0
        public async Task <List <Issue> > GetSubTasksAsync(Issue issue, CancellationToken token = default(CancellationToken))
        {
            List <Issue> result = new List <Issue>();

            int incr  = 0;
            int total = 0;


            do
            {
                IPagedQueryResult <Issue> response = await issue.GetSubTasksAsync(10, incr, token).ConfigureAwait(false);

                total = response.TotalItems;

                incr += response.Count();

                result.AddRange(response);
            }while (incr < total);

            return(result);
        }