public async Task <IActionResult> SubmitBug(SubmitBugListingModel model) { if (ModelState.IsValid) { var jiraResponse = BuildJiraIssue(model); var values = new Dictionary <string, string> { { "title", "[" + jiraResponse + "]" + " " + model.BugSummary }, { "category", "8" }, { "raw", model.BugDescription + Environment.NewLine + model.BuildNumber }, { "api_key", "39946de7bedac9af2676dfca3be92ae943e85ea2dd9f35e12b7ecb6a732b2747" }, { "api_username", "amunford" } }; var content = new FormUrlEncodedContent(values); var response = await _client.PostAsync("http://control4discourse.westus.cloudapp.azure.com/posts.json", content); var responseString = await response.Content.ReadAsStringAsync(); var bugUrl = ""; if (!string.IsNullOrEmpty(jiraResponse)) { var bugSummary = Regex.Replace(model.BugSummary.ToLower(), @"\s-", ""); bugUrl = "http://control4discourse.westus.cloudapp.azure.com/t/" + jiraResponse + "-" + Regex.Replace(bugSummary, @"\s", "-"); } else { var bugSummary = Regex.Replace(model.BugSummary.ToLower(), @"\s-", ""); bugUrl = "http://control4discourse.westus.cloudapp.azure.com/t/" + Regex.Replace(bugSummary, @"\s", "-"); } var submittedBug = new BugSubmittedListingModel { ReferenceNumber = jiraResponse, ForumPostUrl = bugUrl }; return(RedirectToAction("BugSubmitted", "Betas", submittedBug)); } return(View(model)); }
public IActionResult BugSubmitted(BugSubmittedListingModel model) { return(View(model)); }