|
Project
|
YouTrackSharp
|
|
Priority
|
Normal |
|
Type
|
Bug |
|
State
|
Fixed |
|
Assignee
|
Hadi Hariri |
|
Subsystem
|
No subsystem |
|
Fix versions
|
No Fix versions |
|
Affected versions
|
No Affected versions |
|
Fixed in build
|
Next Build |
var connection = new Connection("domain.name", 8080);
connection.Authenticate("root", "password");
var issueManagement = new IssueManagement(connection);
var issue = new Issue
{
Assignee = "Unassigned",
Summary = "...summary...",
Description = "...description...",
ProjectShortName = "1",
Type = "Feature"
};
var issue2 = new Issue
{
Assignee = "Unassigned",
Summary = "...summary2...",
Description = "...description2...",
ProjectShortName = "1",
Type = "Feature"
};
issueManagement.CreateIssue(issue);
// connection.Authenticate("root", "password"); // if uncomment, it works!
issueManagement.CreateIssue(issue2);
If I fail to re-authenticate before calling "AttachFileToIssue" then I get an authorisation failure.
' Connect to YouTrack server Dim YT_Connection As New Connection("server", 8080) YT_Connection.Authenticate("user", "pass") ' Create the issue Dim NewIssue As New Issue() With { .Description = "This is a test issue designed within a prototype to test auto submission of tickets.", .Summary = "A test issue", .ProjectShortName = "ENV", .Type = "Bug" } ' Create an instance of IssueManagement and send it the issue Dim YT_IssueManager As New IssueManagement(YT_Connection) Dim YT_TicketID As String = YT_IssueManager.CreateIssue(NewIssue) ' getScreenshot() takes a screenshot and returns a filename with full path Dim ScreenshotFilename As String = getScreenshot() ' If I remove this call to Authenticate then the AttachFileToIssue will fail with "Unauthorized Unauthorized" error from EasyHTTP YT_Connection.Authenticate("user", "pass") ' Attach file to new ticket YT_IssueManager.AttachFileToIssue(YT_TicketID, ScreenshotFilename)