public void affectProjetIssues(List<Issues> issue) { for (Issues issu : issue) { issu.setProjet(this); this.getListIssues().add(issu); } }
@Test public void should_find_issues() { HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url()); httpServer.stubResponseBody("{\"issues\": [{\"key\": \"ABCDE\"}]}"); IssueClient client = new DefaultIssueClient(requestFactory); IssueQuery query = IssueQuery.create().issues("ABCDE"); Issues issues = client.find(query); assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/search?issues=ABCDE"); assertThat(issues.list()).hasSize(1); assertThat(issues.list().get(0).key()).isEqualTo("ABCDE"); }
public static void save(Time entity) { entity.createdBy = User.find("byUserName", Security.connected()).<User>first(); if (entity.Task != null) { entity.Milestone = Milestone.findById(entity.Task.Milestone.id); } else if (entity.Issue != null) { entity.Milestone = Milestone.findById(entity.Issue.Milestone.id); } validation.valid(entity); if (validation.hasErrors()) { flash.error(Messages.get("scaffold.validation")); render("@create", entity); } entity.save(); flash.success(Messages.get("scaffold.created", "Time")); if (entity.Task != null) { Tasks.show(entity.Task.id); } else { Issues.show(entity.Issue.id); } }