Skip to content

Commit

Permalink
make jira fields null safe
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaniluk committed Jan 30, 2025
1 parent 106b5bd commit 53f8123
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "account" {
}

dynamic "custom_fields" {
for_each = jsondecode(nonsensitive(data.aws_ssm_parameter.jira_account_custom_jira_fields.value))
for_each = try(jsondecode(nonsensitive(data.aws_ssm_parameter.jira_account_custom_jira_fields.value)), [])

content {
target_issue_field = custom_fields.value.target_issue_field
Expand All @@ -105,7 +105,7 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "account" {
}

dynamic "custom_fields" {
for_each = jsondecode(nonsensitive(data.aws_ssm_parameter.jira_account_custom_fixed_fields.value))
for_each = try(jsondecode(nonsensitive(data.aws_ssm_parameter.jira_account_custom_fixed_fields.value)), [])

content {
target_issue_field = custom_fields.value.target_issue_field
Expand Down Expand Up @@ -170,4 +170,4 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "account" {

}
}
}
}
6 changes: 3 additions & 3 deletions compliance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "compliance" {
}

dynamic "custom_fields" {
for_each = jsondecode(nonsensitive(data.aws_ssm_parameter.jira_compliance_custom_jira_fields.value))
for_each = try(jsondecode(nonsensitive(data.aws_ssm_parameter.jira_compliance_custom_jira_fields.value)), [])

content {
target_issue_field = custom_fields.value.target_issue_field
Expand All @@ -105,7 +105,7 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "compliance" {
}

dynamic "custom_fields" {
for_each = jsondecode(nonsensitive(data.aws_ssm_parameter.jira_compliance_custom_fixed_fields.value))
for_each = try(jsondecode(nonsensitive(data.aws_ssm_parameter.jira_compliance_custom_fixed_fields.value)), [])

content {
target_issue_field = custom_fields.value.target_issue_field
Expand Down Expand Up @@ -170,4 +170,4 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "compliance" {

}
}
}
}
6 changes: 3 additions & 3 deletions cost.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "cost" {
}

dynamic "custom_fields" {
for_each = jsondecode(nonsensitive(data.aws_ssm_parameter.jira_cost_custom_jira_fields.value))
for_each = try(jsondecode(nonsensitive(data.aws_ssm_parameter.jira_cost_custom_jira_fields.value)), [])

content {
target_issue_field = custom_fields.value.target_issue_field
Expand All @@ -105,7 +105,7 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "cost" {
}

dynamic "custom_fields" {
for_each = jsondecode(nonsensitive(data.aws_ssm_parameter.jira_cost_custom_fixed_fields.value))
for_each = try(jsondecode(nonsensitive(data.aws_ssm_parameter.jira_cost_custom_fixed_fields.value)), [])

content {
target_issue_field = custom_fields.value.target_issue_field
Expand Down Expand Up @@ -170,4 +170,4 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "cost" {

}
}
}
}
6 changes: 3 additions & 3 deletions security.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "security" {
}

dynamic "custom_fields" {
for_each = jsondecode(nonsensitive(data.aws_ssm_parameter.jira_security_custom_jira_fields.value))
for_each = try(jsondecode(nonsensitive(data.aws_ssm_parameter.jira_security_custom_jira_fields.value)), [])

content {
target_issue_field = custom_fields.value.target_issue_field
Expand All @@ -132,7 +132,7 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "security" {
}

dynamic "custom_fields" {
for_each = jsondecode(nonsensitive(data.aws_ssm_parameter.jira_security_custom_fixed_fields.value))
for_each = try(jsondecode(nonsensitive(data.aws_ssm_parameter.jira_security_custom_fixed_fields.value)), [])

content {
target_issue_field = custom_fields.value.target_issue_field
Expand Down Expand Up @@ -197,4 +197,4 @@ resource "pagerduty_jira_cloud_account_mapping_rule" "security" {

}
}
}
}

0 comments on commit 53f8123

Please sign in to comment.