Skip to content

Commit 91807f2

Browse files
committed
Merge remote-tracking branch 'origin/main' into 6.x
2 parents 6e0ff51 + e8a261a commit 91807f2

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

src/main/java/org/gitlab4j/api/ProjectApi.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,8 @@ public Project updateProject(Project project) throws GitLabApiException {
13551355
formData.withParam("issue_branch_template", project.getIssueBranchTemplate());
13561356
formData.withParam("merge_commit_template", project.getMergeCommitTemplate());
13571357
formData.withParam("squash_commit_template", project.getSquashCommitTemplate());
1358+
formData.withParam("merge_requests_template", project.getMergeRequestsTemplate());
1359+
formData.withParam("issues_template", project.getIssuesTemplate());
13581360

13591361
if (project.getTagList() != null && !project.getTagList().isEmpty()) {
13601362
formData.withParam("tag_list", String.join(",", project.getTagList()));
@@ -2254,7 +2256,7 @@ public ProjectHook addHook(Object projectIdOrPath, String url, boolean doPushEve
22542256
boolean doIssuesEvents, boolean doMergeRequestsEvents) throws GitLabApiException {
22552257
return addHook(projectIdOrPath, url, doPushEvents, doIssuesEvents, doMergeRequestsEvents, null);
22562258
}
2257-
2259+
22582260
/**
22592261
* Adds a hook to project.
22602262
* Convenience method for {@link #addHook(Object, String, ProjectHook, Boolean, String)}
@@ -4044,7 +4046,7 @@ public ProjectAccessToken createProjectAccessToken(Object projectIdOrPath, Strin
40444046
public ProjectAccessToken rotateProjectAccessToken(Object projectIdOrPath, Long tokenId) throws GitLabApiException {
40454047
return rotateProjectAccessToken(projectIdOrPath, tokenId, null);
40464048
}
4047-
4049+
40484050
/**
40494051
* Rotates the given project access token.
40504052
* The token is revoked and a new one which will expire in one week is created to replace it.

src/main/java/org/gitlab4j/api/models/Project.java

+19
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ public String toString() {
119119
private String mergeCommitTemplate;
120120
private String squashCommitTemplate;
121121
private String issueBranchTemplate;
122+
private String mergeRequestsTemplate;
123+
private String issuesTemplate;
124+
122125
@JsonProperty("_links")
123126
private Map<String, String> links;
124127

@@ -950,6 +953,22 @@ public void setIssueBranchTemplate(String issueBranchTemplate) {
950953
this.issueBranchTemplate = issueBranchTemplate;
951954
}
952955

956+
public String getMergeRequestsTemplate() {
957+
return mergeRequestsTemplate;
958+
}
959+
960+
public void setMergeRequestsTemplate(String mergeRequestsTemplate) {
961+
this.mergeRequestsTemplate = mergeRequestsTemplate;
962+
}
963+
964+
public String getIssuesTemplate() {
965+
return issuesTemplate;
966+
}
967+
968+
public void setIssuesTemplate(String issuesTemplate) {
969+
this.issuesTemplate = issuesTemplate;
970+
}
971+
953972
public Map<String, String> getLinks() {
954973
return links;
955974
}

src/test/resources/org/gitlab4j/api/project.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@
9696
"merge_commit_template": "Merge branch '%{source_branch}' into '%{target_branch}'",
9797
"squash_commit_template": "Commit %{title}",
9898
"issue_branch_template" : "issue-%{id}",
99+
"merge_requests_template": "",
100+
"issues_template": "",
99101
"autoclose_referenced_issues" : true,
100102
"permissions" : {
101103
"project_access" : {
@@ -125,4 +127,4 @@
125127
"packages_size" : 0
126128
},
127129
"custom_attributes" : [ ]
128-
}
130+
}

0 commit comments

Comments
 (0)