Esempio n. 1
0
        internal static string SubmitToYouTrack(string summary, string description, string youTrackProjectKey, BookModel bookModel = null)
        {
            bool isSilenced = AlertManager.Instance.RecordAlertAndCheckIfSilenced(bookModel);

            if (isSilenced)
            {
                // Alerts are silenced because too many alerts.
                // Skip creating the YouTrack issue for this.
                return("");
            }
            var submitter = new Bloom.YouTrackIssueSubmitter(youTrackProjectKey);

            return(submitter.SubmitToYouTrack(summary, description));
        }
        public void TestIssueSubmission()
        {
            var issueId = YouTrackIssueConnector.SubmitToYouTrack("Harvester Test Issue",
                                                                  "This is a test from Harvester, which apparently cannot be overemphasized.", "AUT");

            Assert.That(issueId, Is.Not.Null);
            Assert.That(issueId, Does.StartWith("AUT-"));

            // Creating a new submitter seems a bit wasteful, and a bit too far into implementation details,
            // but it's the only way to delete the newly created issue.
            var submitter = new Bloom.YouTrackIssueSubmitter("AUT");
            var deleted   = submitter.DeleteIssue(issueId);

            Assert.That(deleted, Is.True);
        }