Skip to content

Commit

Permalink
Change Validate function to support Jira 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
acenolaza committed May 19, 2015
1 parent 4107352 commit e88c768
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion VersionOne.JiraConnector/Rest/JiraRestProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class JiraRestProxy : IJiraConnector
{
private readonly RestClient client;

private readonly string currentUser;

public JiraRestProxy(string baseUrl)
: this(baseUrl, string.Empty, string.Empty)
{
Expand All @@ -26,16 +28,19 @@ public JiraRestProxy(string baseUrl, string username, string password)
{
client.Authenticator = new HttpBasicAuthenticator(username, password);
}

currentUser = username;
}

public bool Validate()
{
var request = new RestRequest
{
Method = Method.GET,
Resource = "myself",
Resource = "user",
RequestFormat = DataFormat.Json
};
request.AddQueryParameter("username", currentUser);

var response = client.Execute(request);

Expand Down

0 comments on commit e88c768

Please sign in to comment.