You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi Team
Please help me my code are give below I am not able to post a comment in any issue . so please help me asap.
string result = string.Empty;
var jsonstring = @"{""update"":{""comment"": [ { ""add"": { ""body"": ""This is comment ""}}]}}";
try
{
//string restUrl = String.Format("{0}rest/api/2/issue/{1}/comment", Url, obj.issueid);
string postUrl = String.Format("{0}rest/api/2/issue/{1}", Url, obj.issueid);
HttpWebResponse response = null;
HttpWebRequest request = WebRequest.Create(postUrl) as HttpWebRequest;
request.Method = "PUT";
request.Accept = "application/json";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "Basic " + GetEncodedCredentials(UserName, Password));
byte[] data = Encoding.UTF8.GetBytes(jsonstring);
using (Stream postStream = request.GetRequestStream())
{
postStream.Write(data, 0, data.Length);
}
using (response = request.GetResponse() as HttpWebResponse)
{
if (response.StatusCode == HttpStatusCode.Created)
{
}
}