コード例 #1
0
        public int GetNumIssues(
            int boardId,
            int sprintId,
            string state         = "active",
            List <string> fields = null,
            int startAt          = 0,
            int maxResult        = 50)
        {
            SearchRequestBoards request = new SearchRequestBoards();

            request.ProjectKeyOrId = "VATT";
            request.MaxResults     = maxResult;
            request.StartAt        = startAt;

            string data = JsonConvert.SerializeObject(request);


            string extUrl = "rest/agile/1.0/board/";

            string argument = string.Format("{0}{1}{2}{3}{4}/", extUrl, boardId, "/sprint/", sprintId, "/issue/");
            //string result = RunQueryBoard();
            string result = RunQuery(argument);

            IssueDescription issueDescription = JsonConvert.DeserializeObject <IssueDescription>(result);

            return(issueDescription.Total);
        }
コード例 #2
0
ファイル: ManageIssue.cs プロジェクト: coridrew/IssueCreator
        protected async Task ExecuteIssueOperation(Func <long, int, long, int, Task <bool> > action, string scopeText)
        {
            using IDisposable scope = _logger.CreateScope(scopeText);

            setValidation(true);

            if (!this.ValidateChildren())
            {
                return;
            }
            // get the repository
            (string owner, string repo) = UIHelpers.GetRepoOwner(cboAvailableRepos.SelectedItem);

            RepositoryInfo repoFromGH = await _issueManager.GetRepositoryAsync(owner, repo);

            IssueDescription epicInfo = cboEpics.SelectedItem as IssueDescription;

            bool result = await action(epicInfo.Repo.Id, epicInfo.Issue.Number, repoFromGH.Id, int.Parse(txtIssueNumber.Text));

            if (!result)
            {
                MessageBox.Show("Coult not associate the issue with the epic");
            }
            else
            {
                MessageBox.Show("Done!");
            }
        }
コード例 #3
0
        private async Task ExecuteIssueOperation(Func <long, int, long, int, Task <bool> > action)
        {
            if (!int.TryParse(txtIssueNumber.Text, out int issueNumber))
            {
                MessageBox.Show("Please specify a number for the issue");
            }

            if (cboAvailableRepos.SelectedItem == null)
            {
                MessageBox.Show("Please select a repository");
            }

            if (cboEpics.SelectedItem == null)
            {
                MessageBox.Show("Please select an epic");
            }

            // get the repository
            (string owner, string repo) = UIHelpers.GetRepoOwner(cboAvailableRepos.SelectedItem);

            RepositoryInfo repoFromGH = await _issueManager.GetRepositoryAsync(owner, repo);

            IssueDescription epicInfo = cboEpics.SelectedItem as IssueDescription;

            bool result = await action(epicInfo.Repo.Id, epicInfo.Issue.Number, repoFromGH.Id, issueNumber);

            if (!result)
            {
                MessageBox.Show("Coult not associate the issue with the epic");
            }
            else
            {
                MessageBox.Show("Done!");
            }
        }
コード例 #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = QualityCondition.GetHashCode();
         result = (result * 397) ^ (IssueCode?.GetHashCode() ?? 0);
         result = (result * 397) ^ (AffectedComponent?.GetHashCode() ?? 0);
         result = (result * 397) ^ (IssueDescription?.GetHashCode() ?? 0);
         return(result);
     }
 }
コード例 #5
0
ファイル: ManageIssue.cs プロジェクト: coridrew/IssueCreator
        private async void btnBrowseEpic_Click(object sender, EventArgs e)
        {
            using IDisposable scope = _logger.CreateScope("Browse epic");
            if (cboEpics.SelectedItem != null)
            {
                IssueDescription issue = cboEpics.SelectedItem as IssueDescription;

                string link = (await _issueManager.GetBrowseableIssueAsync(issue.Repo.Id, issue.Issue.Number)).HtmlUrl;
                _logger.Log($"Found issue html link: {link}");

                // this is a point-in-time check until the updated cache catches up.
                if (link != null)
                {
                    _logger.Log("Launching browser");
                    Process.Start(link);
                }
            }
        }