Exemple #1
0
        public async Task <IActionResult> CreateIssue(IssueViewModel issueVM, int statusId, int storyId, int sprintId)
        {
            if (ModelState.IsValid)
            {
                Status status = await _plansService.GetStatus(new ServiceContext()
                {
                    ContextId = "TEST"
                }, issueVM.StatusId);

                Story story = await _plansService.GetStory(new ServiceContext()
                {
                    ContextId = "TEST"
                }, issueVM.StoryId);

                Issue issue = issueVM.ViewModelToEntity(status, story);

                await _plansService.CreateIssue(new ServiceContext()
                {
                    ContextId = "TEST"
                }, issue);

                return(RedirectToAction(nameof(Index), new { id = issueVM.SprintId }));
            }
            issueVM.StatusId = statusId;
            issueVM.StoryId  = storyId;
            issueVM.SprintId = sprintId;
            return(View(issueVM));
        }