diff --git a/jira/resource_project.go b/jira/resource_project.go index 0de9f8ff..052757d6 100644 --- a/jira/resource_project.go +++ b/jira/resource_project.go @@ -45,7 +45,7 @@ type ProjectRequest struct { IssueSecurityScheme int `json:"issueSecurityScheme,omitempty" structs:"issueSecurityScheme,omitempty"` PermissionScheme int `json:"permissionScheme,omitempty" structs:"permissionScheme,omitempty"` NotificationScheme int `json:"notificationScheme,omitempty" structs:"notificationScheme,omitempty"` - CategoryID int `json:"categoryId,omitempty" structs:"categoryId,omitempty"` + CategoryID string `json:"categoryId,omitempty" structs:"categoryId,omitempty"` } type SharedConfigurationProjectResponse struct { @@ -154,7 +154,7 @@ func resourceProject() *schema.Resource { Optional: true, }, "category_id": &schema.Schema{ - Type: schema.TypeInt, + Type: schema.TypeString, Optional: true, }, }, @@ -207,7 +207,7 @@ func resourceProjectCreate(d *schema.ResourceData, m interface{}) error { IssueSecurityScheme: d.Get("issue_security_scheme").(int), PermissionScheme: d.Get("permission_scheme").(int), NotificationScheme: d.Get("notification_scheme").(int), - CategoryID: d.Get("category_id").(int), + CategoryID: d.Get("category_id").(string), } returnedProject := new(IDResponse) @@ -289,7 +289,7 @@ func resourceProjectUpdate(d *schema.ResourceData, m interface{}) error { IssueSecurityScheme: d.Get("issue_security_scheme").(int), PermissionScheme: d.Get("permission_scheme").(int), NotificationScheme: d.Get("notification_scheme").(int), - CategoryID: d.Get("category_id").(int), + CategoryID: d.Get("category_id").(string), } urlStr := fmt.Sprintf("%s/%s", projectAPIEndpoint, d.Id()) diff --git a/jira/resource_project_test.go b/jira/resource_project_test.go index 38f16539..32fc3757 100644 --- a/jira/resource_project_test.go +++ b/jira/resource_project_test.go @@ -108,12 +108,18 @@ resource "jira_user" "foo" { email = "example@example.org" } +resource "jira_project_category" "category" { + name = "Managed" + description = "Managed Projects" +} + resource "jira_project" "foo" { name = "foo-name-%d" key = "PX%d" lead = "${jira_user.foo.name}" project_type_key = "business" project_template_key = "com.atlassian.jira-core-project-templates:jira-core-project-management" + category_id = "${jira_project_category.category.id}" }`, rInt, rInt, rInt%100000) } @@ -125,12 +131,18 @@ resource "jira_user" "foo" { email = "example@example.org" } +resource "jira_project_category" "category" { + name = "Managed" + description = "Managed Projects" +} + resource "jira_project" "foo" { name = "foo-changed-name-%d" key = "PX%d" lead = "${jira_user.foo.name}" project_type_key = "software" project_template_key = "com.atlassian.jira-core-project-templates:jira-core-project-management" + category_id = "${jira_project_category.category.id}" }`, rInt, rInt, rInt%100000) }