private void markMergeRequestAsWIP ( ) { if ( ! this . api . getShouldSetWIP ( ) ) { return ; } final String currentTitle = mergeRequest . getTitle ( ) ; final String startTitle = "WIP: (VIOLATIONS) " ; if ( currentTitle . startsWith ( startTitle ) ) { // To avoid setting WIP again on new comments return ; } final Integer projectId = this . project . getId ( ) ; final Integer mergeRequestIid = this . mergeRequest . getIid ( ) ; final String targetBranch = null ; final Integer assigneeId = null ; final String title = startTitle + currentTitle ; final String description = null ; final Constants . StateEvent stateEvent = null ; final String labels = null ; final Integer milestoneId = null ; final Boolean removeSourceBranch = null ; final Boolean squash = null ; final Boolean discussionLocked = null ; final Boolean allowCollaboration = null ; try { mergeRequest . setTitle ( title ) ; gitLabApi . getMergeRequestApi ( ) . updateMergeRequest ( projectId , mergeRequestIid , targetBranch , title , assigneeId , description , stateEvent , labels , milestoneId , removeSourceBranch , squash , discussionLocked , allowCollaboration ) ; } catch ( final Throwable e ) { violationsLogger . log ( SEVERE , e . getMessage ( ) , e ) ; } }
Set the merge request as Work in Progress if configured to do so by the shouldSetWIP flag .