public double GetSized(string team) { using (var client = new HttpClient()) { var byteArray = new System.Text.UTF8Encoding().GetBytes("AutomationService:Aut0mate0n!"); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray)); ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; HttpResponseMessage response = client.GetAsync(getSizedURL(team)).Result; if (response.IsSuccessStatusCode) { string r = response.Content.ReadAsStringAsync().Result; ResponseSized result1 = JsonConvert.DeserializeObject <ResponseSized>(r); List <Issue> l = result1.issues; double total = l.Sum(item => int.Parse(item.fields.customfield_10003)); return(total); } else { Debug.WriteLine("failed Query"); return(0.0); } } }
public double GetAllSized(string team) { using (var client = new HttpClient()) { var byteArray = new System.Text.UTF8Encoding().GetBytes("AutomationService:Aut0mate0n!"); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray)); ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; HttpResponseMessage response = client.GetAsync("https://jira.whipplehill.com/rest/api/2/search?filter=14601&jql=project%20in%20(onBoard%2C%20onCampus%2C%20onRecord%2C%20onMessage)%20AND%20(sprint%20not%20in%20openSprints()%20AND%20sprint%20not%20in%20closedSprints()%20OR%20sprint%20is%20EMPTY)%20AND%20%22Story%20Points%22%20is%20not%20EMPTY%20AND%20status%20not%20in%20(Released%2C%20Closed)%20ORDER%20BY%20summary%20ASC%2C%20cf%5B10300%5D%20ASC&maxResults=1000").Result; if (response.IsSuccessStatusCode) { string r = response.Content.ReadAsStringAsync().Result; ResponseSized result1 = JsonConvert.DeserializeObject <ResponseSized>(r); List <Issue> l = result1.issues; double total = l.Sum(item => int.Parse(item.fields.customfield_10003)); return(total); } else { Debug.WriteLine("failed Query"); return(0.0); } } }