Hi All,
We have a field "Assignee Group" has few options (Development, UAT,etc..)
This is a dropdown field and am trying to update this field using issue transition.
using this rest url :
https://abc.atlassian.net/rest/api/3/issue/{issue key}/transitions?expand=transitions.fields
pls find the below json for the same.
{
"update": {
},
"fields": {
"customfield_ID": { "value": "UAT" }
},
"transition": {
"id": "201"
}
}
But i am unable to update it and giving "The remote server returned an error: (400) Bad Request."
Can anyone give me some idea , what i am doing wrong in above ...
And also pls guide me - can we do update custom field through issue transitions?
If not what is the possible options to update the custom field to Jira.
Thanks
Vishnu
@[deleted] Can you please share full command with headers. CURL will also work.
It seems error is related with 'Accept' and 'Content-Type' headers, value of those should be 'application/json'
Thanks for your reply. I am using C# .Net programming as mentioned below.
var req = HttpWebRequest)WebRequest.Create("https://abc.atlassian.net/rest/api/3/issue/{IssueKey}/transitions?expand=transitions.fields");
var authInfo = "JiraUName:APIToken";
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
req.Headers["Authorization"] = "Basic " + authInfo;
req.Method = "POST";
req.ContentType = "application/json";
var requestStream = req.GetRequestStream();
var encoding = new ASCIIEncoding();
int transitionID = 201;
string fileContent = File.ReadAllText(@"C:\JIRARESTAPIJSON\Working_JSON_JIRA\IssueTransition_AGroup.json");
fileContent = fileContent.Replace("{0}", transitionID.ToString());
fileContent = fileContent.Replace("{1}", "Fixed");
JObject json = JObject.Parse(fileContent);
var serialized = JsonConvert.SerializeObject(json);
var buffer = encoding.GetBytes(serialized);
requestStream.Write(buffer, 0, buffer.Length);
requestStream.Flush();
requestStream.Close();
HttpWebResponse response = req.GetResponse() as HttpWebResponse;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.