Hello - we are currently looking at upgrading from Jira 6.3.12 to Jira 7.4.2. Currently we have written some custom code that accesses the Jira rest apis.
As far as I can see - looking through the documentation - there should be no affect on the api's we are calling - currently the CreateIssue api - POST /rest/api/2/issue . Please see below for the code:-
/* these variables are hardcoded for this example, in ION most are passed in from the user interface */ String jiraHost = "http://jira.fsi:8080/"
String jiraProject = "IURI";
String messageWithVersion = "ION Version 1.0.38.2807: ION is not saving my research"; String summ = "<p> ION is not saving my research, see below. <br /> <img src='/api/file/12232' ></img> </p>"
String uname = "Daniel.shaw@firststateinvestments.com";
String issueType = "Bug";
Uri address = new Uri(JiraHost + "rest/api/2/issue"); dynamic remoteMessage = new
{
fields = new
{
project = new { key = jiraProject },
summary = summ,
description = messageWithVersion,
issuetype = new { name = issueType },
customfield_10000 = uname
}
};
String json = Newtonsoft.Json.JsonConvert.SerializeObject(remoteMessage);
byte[] byteData = UTF8Encoding.UTF8.GetBytes(json);
HttpWebRequest JIRARequest = WebRequest.Create(address) as HttpWebRequest;
// Set type to POST
JIRARequest.Method = "POST";
// Set the content length in the request headers
JIRARequest.ContentLength = byteData.Length;
JIRARequest.ContentType = "application/json";
/* code block for the GetEncodedCredentials function below private string GetEncodedCredentials()
{
string mergedCredentials = string.Format("{0}:{1}", "ionuser", "F1rststate");
byte[] byteCredentials = UTF8Encoding.UTF8.GetBytes(mergedCredentials);
return Convert.ToBase64String(byteCredentials);
}
*/
string base64Credentials = GetEncodedCredentials();
JIRARequest.Headers.Add("Authorization", "Basic " + base64Credentials);
// Write data
using (Stream postStream = JIRARequest.GetRequestStream())
{
postStream.Write(byteData, 0, byteData.Length);
}
try
{
HttpWebResponse response = JIRARequest.GetResponse() as HttpWebResponse;
// Get the response stream
StreamReader reader = new StreamReader(response.GetResponseStream());
string resString = reader.ReadToEnd();
log.DebugFormat("Response Received for JSON POST: {0}", resString);
//.... [Bunch of irrelavent stuff]
catch (Exception ex)
{
log.Error("Error Posting JIRA ", ex);
return;
}