88
99import com .fasterxml .jackson .databind .JsonNode ;
1010import com .fasterxml .jackson .databind .node .ObjectNode ;
11+ import controllers .MigrationApp ;
12+ import controllers .annotation .AnonymousCheck ;
1113import controllers .annotation .IsAllowed ;
1214import models .*;
1315import models .enumeration .Operation ;
@@ -41,6 +43,8 @@ public static Result exports(String owner, String projectName) {
4143 json .put ("milestoneCount" , project .milestones .size ());
4244 json .put ("issues" , composePosts (project , Issue .finder ));
4345 json .put ("posts" , composePosts (project , Posting .finder ));
46+ json .put ("milestones" , toJson (project .milestones .stream ()
47+ .map (MigrationApp ::composeMilestoneJson ).collect (Collectors .toList ())));
4448 return ok (json );
4549 }
4650
@@ -54,6 +58,7 @@ private static <T> JsonNode composePosts(Project project, Model.Finder<Long, T>
5458
5559 private static ObjectNode getResult (AbstractPosting posting ) {
5660 ObjectNode json = Json .newObject ();
61+ json .put ("id" , posting .getNumber ());
5762 json .put ("title" , posting .title );
5863 json .put ("type" , posting .asResource ().getType ().toString ());
5964 json .put ("author" , posting .authorLoginId );
@@ -63,6 +68,8 @@ private static ObjectNode getResult(AbstractPosting posting) {
6368
6469 if (posting .asResource ().getType () == ResourceType .ISSUE_POST ){
6570 Optional .ofNullable (((Issue )posting ).assignee ).ifPresent (assignee -> json .put ("assignee" , assignee .user .loginId ));
71+ Optional .ofNullable (((Issue )posting ).milestone ).ifPresent (milestone -> json .put ("milestone" , milestone .title ));
72+ Optional .ofNullable (((Issue )posting ).milestone ).ifPresent (milestone -> json .put ("milestoneId" , milestone .id ));
6673 }
6774 List <Attachment > attachments = Attachment .findByContainer (posting .asResource ());
6875 if (attachments .size () > 0 ) {
0 commit comments