public static async Task CreateSprint(string?profile) { var service = await ProfileHelpers.GetJiraSprintService(profile); if (service is null) { Console.WriteLine("Can't find default profile"); return; } var sprint = await ConsoleI.RenderForm <TerminalJiraSprint>(); if (sprint is null) { Console.WriteLine("Sprint is invalid"); return; } var success = service .CreateSprint(sprint); if (success) { Console.WriteLine($"Created sprint {sprint.Name}"); } else { Console.WriteLine($"Sprint with name [{sprint.Name}] already exists"); } }
public static async Task StartDemo() { ConsoleI.RegisterDefaults(); var data = await ConsoleI.RenderForm <TestFormClass>(); Console.WriteLine($"Result: {data}"); ConsoleI.AwaitContinue(); }
private static async Task CreateNewProfile() { var count = (await JiraProfileService.GetAvailableProfiles()).Count(); var profile = await ConsoleI.RenderForm <TerminalJiraProfile>(); var isDefault = ConsoleI.AskConfirmation("Set as default profile"); var service = await JiraProfileService.Create(profile, ""); Console.WriteLine("Created profile " + profile.ProfileName); if (count == 0 || isDefault) { await service.SetAsDefault(); Console.WriteLine("Profile set as default"); } }