Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

error in posting a comment in any issue using HttpWebResponse or HttpClient

Edited

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)
{

}

}

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events