I am trying to update an existing issue in our JIRA Cloud project. I am using the following C# code:
string newAssignee = "New Assignee";
string jsonString = @"{""fields"":""assignee"":""name"":" + "\"" + newAssignee + "\"";
TryJira.Jira objJira2 = new TryJira.Jira();
objJira2.JiraUrl = System.Configuration.ConfigurationManager.AppSettings["JiraUrl"];
objJira2.JiraJson = jsonString;
objJira2.JiraUserName = System.Configuration.ConfigurationManager.AppSettings["JiraUserName"];
objJira2.JiraPassword = System.Configuration.ConfigurationManager.AppSettings["JiraPassword"];
objJira2.addJiraIssue();
namespace RetrieveTasks
{
public class Jira
{
public String addJiraIssue()
{
JiraService.open("PUT", JiraUrl + "/rest/api/2/issue/NPI-24");
JiraService.setRequestHeader("Content-Type", "application/json");
JiraService.setRequestHeader("Accept", "application/json");
JiraService.setRequestHeader("X-Atlassian-Token", "nocheck");
JiraService.setRequestHeader("Authorization", "Basic " + GetEncodedCredentials());
JiraService.send(JiraJson);
String response = JiraService.responseText;
JiraService.abort();
return response;
}
}
}
When I check the “response” value it is a JSON-formatted retrieval of the entire project and the assignee hasn’t been changed. I don’t receive any errors.