I am trying to put together some queries to use in my app making JIRA api calls to get the data. The big thing is to try and get jiras where issuetype = Bug, given a specific project. I would like to use the POST method as going forward the queries may get more complicated. What I have so far is:
string postData = "{\"jql\":\"project = Myproject\", \"fields\": {\"issuetype\":{\"name\":\"Bug\"}}}";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
string encodedCreds = Base64Encode("username:password"); //this needs to be changed to Qed Arsenal access info once that gets setup
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("company specific url");
request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "Basic " + encodedCreds);
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse();
dataStream = webResponse.GetResponseStream();
StreamReader responseReader = new StreamReader(dataStream);
string res = responseReader.ReadToEnd();
responseReader.Close();
dataStream.Close();
return res;