public JqlSearchResult SearchIssues(JqlSearchBean jqlSearchBean)
        {
            var json              = JsonSerializer.Serialize(jqlSearchBean);
            var uri               = UriHelper.BuildPath(BaseUri, RestPathConstants.Search);
            var httpContent       = new StringContent(json, Encoding.UTF8, "application/json");
            var response          = Client.PostAsync(uri.ToString(), httpContent);
            var readAsStringAsync = response.Result.Content.ReadAsStringAsync();
            var result            = readAsStringAsync.Result;

            return(JsonSerializer.Deserialize <JqlSearchResult>(result));
        }
Esempio n. 2
0
        public JqlSearchResult SearchIssues(JqlSearchBean jqlsearchbean)
        {
            string json    = JsonConvert.SerializeObject(jqlsearchbean, Formatting.Indented);
            var    content = new StringContent(json, Encoding.UTF8, "application/json");
            Uri    url     = new Uri(baseUri, RestPathConstants.SEARCH);

            using (HttpResponseMessage result = client.PostAsync(url, content).Result)
                using (Stream s = result.Content.ReadAsStreamAsync().Result)
                    using (StreamReader sr = new StreamReader(s))
                        using (JsonReader reader = new JsonTextReader(sr))
                        {
                            return(serializer.Deserialize <JqlSearchResult>(reader));
                        }
        }
Esempio n. 3
0
        public void TestSearchIssues()
        {
            var jsb     = new JqlSearchBean();
            var builder = new JqlBuilder();
            var jql     = builder.AddCondition(EField.Project, EOperator.EQUALS, "DEMO")
                          .And().AddCondition(EField.Status, EOperator.EQUALS, Constants.StatusInProgress)
                          .OrderBy(SortOrder.Asc, EField.Created);

            jsb.Jql = jql;
            jsb.AddField(EField.IssueKey, EField.Status, EField.Due, EField.Summary, EField.IssueType, EField.Priority, EField.Updated, EField.Transitions);
            jsb.AddExpand(EField.Transitions);
            var result = RestClient.SearchClient.SearchIssues(jsb);

            result.Should().NotBeNull();
        }