public GitlabMilestone createMilestone ( Serializable projectId , String title , String description , Date dueDate , Date startDate ) throws IOException { String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + GitlabMilestone . URL ; GitlabHTTPRequestor requestor = dispatch ( ) . with ( "title" , title ) ; SimpleDateFormat formatter = new SimpleDateFormat ( "yyyy-MM-dd" ) ; if ( description != null ) { requestor = requestor . with ( "description" , description ) ; } if ( dueDate != null ) { requestor = requestor . with ( "due_date" , formatter . format ( dueDate ) ) ; } if ( startDate != null ) { requestor = requestor . with ( "start_date" , formatter . format ( startDate ) ) ; } return requestor . to ( tailUrl , GitlabMilestone . class ) ; }
Cretaes a new project milestone .