Пример #1
0
        public static void PdfPrinter(FilterResults results)
        {
            PdfDocument pdf = new PdfDocument();
            int numPages;
            int reminder = 0;

            results.issues.OrderBy(i => i.fields.issuetype.name);
            List<JiraTicket> issues = new List<JiraTicket>();

                numPages = results.issues.Count / 6 + 1;
                reminder = results.issues.Count % 6;

                for (int i = 0; i < numPages - 1; i++)
                {
                    issues = results.issues.Skip(i*6).Take(6).ToList();
                    CreatePdfPage(issues, ref pdf);
                }

                if (reminder > 0)
                {
                    issues = results.issues.Skip((numPages-1)*6).Take(reminder).ToList();
                    CreatePdfPage(issues, ref pdf);
                }

            pdf.Save("C:/ProgramData/JiraCharts/issues.pdf");
        }
Пример #2
0
        public void getSprintResults()
        {
            CookieContainer cookies = new CookieContainer();
            FilterResults results = new FilterResults();
            string url;
            DateTime sprintStartDate = DateTime.Now;
            DateTime sprintEndDate = DateTime.Now;

            cookies = JiraMethods.jiraAuthentication();
            JiraMethods.getStartAndEndDate(cookies, out sprintStartDate, out sprintEndDate);
            url = "http://dev-aus-jira-01.swdev.local/rest/api/2/search?jql=project+%3D+%22Unified+IT+Manager%22+AND+created>" + "'" + sprintStartDate.ToString("yyyy-MM-dd") + "'" + "AND+created<=" + "'" + sprintEndDate.ToString("yyyy-MM-dd") + "'&maxResults=100";
            results = JiraMethods.deserializeFilterResults(url, cookies);

            this.itemsCount = results.total;
            this.bugCount = 0;

            foreach(JiraTicket jt in results.issues)
            {
                if (jt.fields.issuetype.name == "Bug")
                    this.bugCount += 1;
            }

            this.PriorityStats = JiraMethods.getPriorityStats(results.issues);
            this.StatusStats =  JiraMethods.getStatusStats(results.issues);
            this.BugsPerDayStats = JiraMethods.getBugsPerDayStats(results.issues);
            this.UndefinedBugs = JiraMethods.getUndefinedBugs(results.issues);
            this.TimeStamp = DateTime.Now;

            Email.sendEmail(UndefinedBugs);
        }
Пример #3
0
        public static FilterResults deserializeFilterResults(string url, CookieContainer cookies)
        {
            string         resultJson;
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

            request.CookieContainer = cookies;

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            resultJson = readHttpResponse(response);

            FilterResults results = JsonConvert.DeserializeObject <FilterResults>(resultJson, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });

            return(results);
        }
Пример #4
0
        public static FilterResults deserializeFilterResults(string username, string password, string jql)
        {
            string resultJson;
            string url = "http://dev-aus-jira-01.swdev.local/rest/api/2/search?jql=" + jql + "&os_username="******"&os_password=" + password;

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);


            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            resultJson = readHttpResponse(response);

            FilterResults results = JsonConvert.DeserializeObject <FilterResults>(resultJson, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });

            return(results);
        }