@@ -290,6 +290,14 @@ var resourceGitLabProjectSchema = map[string]*schema.Schema{
290
290
Type : schema .TypeString ,
291
291
Optional : true ,
292
292
},
293
+ "issues_template" : {
294
+ Type : schema .TypeString ,
295
+ Optional : true ,
296
+ },
297
+ "merge_requests_template" : {
298
+ Type : schema .TypeString ,
299
+ Optional : true ,
300
+ },
293
301
"ci_config_path" : {
294
302
Type : schema .TypeString ,
295
303
Optional : true ,
@@ -349,6 +357,8 @@ func resourceGitlabProjectSetToState(d *schema.ResourceData, project *gitlab.Pro
349
357
d .Set ("mirror_overwrites_diverged_branches" , project .MirrorOverwritesDivergedBranches )
350
358
d .Set ("only_mirror_protected_branches" , project .OnlyMirrorProtectedBranches )
351
359
d .Set ("build_coverage_regex" , project .BuildCoverageRegex )
360
+ d .Set ("issues_template" , project .IssuesTemplate )
361
+ d .Set ("merge_requests_template" , project .MergeRequestsTemplate )
352
362
d .Set ("ci_config_path" , project .CIConfigPath )
353
363
return nil
354
364
}
@@ -551,6 +561,14 @@ func resourceGitlabProjectCreate(ctx context.Context, d *schema.ResourceData, me
551
561
editProjectOptions .ImportURL = gitlab .String (d .Get ("import_url" ).(string ))
552
562
}
553
563
564
+ if v , ok := d .GetOk ("issues_template" ); ok {
565
+ editProjectOptions .IssuesTemplate = gitlab .String (v .(string ))
566
+ }
567
+
568
+ if v , ok := d .GetOk ("merge_requests_template" ); ok {
569
+ editProjectOptions .MergeRequestsTemplate = gitlab .String (v .(string ))
570
+ }
571
+
554
572
if (editProjectOptions != gitlab.EditProjectOptions {}) {
555
573
if _ , _ , err := client .Projects .EditProject (d .Id (), & editProjectOptions , gitlab .WithContext (ctx )); err != nil {
556
574
return diag .Errorf ("Could not update project %q: %s" , d .Id (), err )
@@ -724,6 +742,14 @@ func resourceGitlabProjectUpdate(ctx context.Context, d *schema.ResourceData, me
724
742
options .BuildCoverageRegex = gitlab .String (d .Get ("build_coverage_regex" ).(string ))
725
743
}
726
744
745
+ if d .HasChange ("issues_template" ) {
746
+ options .IssuesTemplate = gitlab .String (d .Get ("issues_template" ).(string ))
747
+ }
748
+
749
+ if d .HasChange ("merge_requests_template" ) {
750
+ options .MergeRequestsTemplate = gitlab .String (d .Get ("merge_requests_template" ).(string ))
751
+ }
752
+
727
753
if d .HasChange ("ci_config_path" ) {
728
754
options .CIConfigPath = gitlab .String (d .Get ("ci_config_path" ).(string ))
729
755
}
0 commit comments