public Comment addComment ( Object projectIdOrPath , String sha , String note , String path , Integer line , LineType lineType ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "note" , note , true ) . withParam ( "path" , path ) . withParam ( "line" , line ) . withParam ( "line_type" , lineType ) ; Response response = post ( Response . Status . CREATED , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "commits" , sha , "comments" ) ; return ( response . readEntity ( Comment . class ) ) ; }
Add a comment to a commit . In order to post a comment in a particular line of a particular file you must specify the full commit SHA the path the line and lineType should be NEW .