Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/override_shifts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type OverrideShift struct {
EndsAt string `jsonapi:"attr,ends_at,omitempty"`
IsOverride *bool `jsonapi:"attr,is_override,omitempty"`
ShiftOverride map[string]interface{} `jsonapi:"attr,shift_override,omitempty"`
User map[string]interface{} `jsonapi:"attr,user,omitempty"`
UserId int `jsonapi:"attr,user_id,omitempty"`
}

func (c *Client) ListOverrideShifts(id string, params *rootlygo.ListOverrideShiftsParams) ([]interface{}, error) {
Expand Down
5 changes: 4 additions & 1 deletion docs/resources/alert_routing_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ description: |-
<a id="nestedblock--destination"></a>
### Nested Schema for `destination`

Optional:
Required:

- `target_id` (String) The ID of the target

Optional:

- `target_type` (String) The type of the target. Value must be one of `Service`, `Group`, `EscalationPolicy`.


Expand Down
2 changes: 1 addition & 1 deletion docs/resources/override_shift.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ description: |-

- `ends_at` (String) End datetime of shift
- `starts_at` (String) Start datetime of shift
- `user_id` (Number) Override shift user

### Optional

- `is_override` (Boolean) Denotes shift is an override shift. Value must be one of true or false
- `rotation_id` (String) ID of rotation
- `schedule_id` (String) ID of schedule
- `shift_override` (Map of String) Override metadata
- `user` (Map of String) User metadata

### Read-Only

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/workflow_action_item.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ Optional:
- `incident_condition_visibility` (String) Value must be one off `IS`, `ANY`, `CONTAINS`, `CONTAINS_ALL`, `CONTAINS_NONE`, `NONE`, `SET`, `UNSET`.
- `incident_conditional_inactivity` (String)
- `incident_inactivity_duration` (String) ex. 10 min, 1h, 3 days, 2 weeks
- `incident_kinds` (List of String) Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`.
- `incident_statuses` (List of String) Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `planning`, `scheduled`, `in_progress`, `verifying`, `completed`.
- `incident_kinds` (List of String) Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`, `scheduled_sub`.
- `incident_statuses` (List of String) Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `scheduled`, `in_progress`, `completed`.
- `incident_visibilities` (List of String)
- `trigger_type` (String) Value must be one off `action_item`.
- `triggers` (List of String) Actions that trigger the workflow. One of custom_fields.<slug>.updated, incident_updated, action_item_created, action_item_updated, assigned_user_updated, summary_updated, description_updated, status_updated, priority_updated, due_date_updated, teams_updated, slack_command
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/workflow_incident.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ Optional:
- `incident_condition_visibility` (String) Value must be one off `IS`, `ANY`, `CONTAINS`, `CONTAINS_ALL`, `CONTAINS_NONE`, `NONE`, `SET`, `UNSET`.
- `incident_conditional_inactivity` (String)
- `incident_inactivity_duration` (String) ex. 10 min, 1h, 3 days, 2 weeks
- `incident_kinds` (List of String) Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`.
- `incident_kinds` (List of String) Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`, `scheduled_sub`.
- `incident_post_mortem_condition_cause` (String) [DEPRECATED] Use incident_condition_cause instead. Value must be one off `IS`, `ANY`, `CONTAINS`, `CONTAINS_ALL`, `CONTAINS_NONE`, `NONE`, `SET`, `UNSET`.
- `incident_statuses` (List of String) Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `planning`, `scheduled`, `in_progress`, `verifying`, `completed`.
- `incident_statuses` (List of String) Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `scheduled`, `in_progress`, `completed`.
- `incident_visibilities` (List of String)
- `trigger_type` (String) Value must be one off `incident`.
- `triggers` (List of String) Actions that trigger the workflow. One of custom_fields.<slug>.updated, incident_in_triage, incident_created, incident_started, incident_updated, title_updated, summary_updated, status_updated, severity_updated, environments_added, environments_removed, environments_updated, incident_types_added, incident_types_removed, incident_types_updated, services_added, services_removed, services_updated, visibility_updated, functionalities_added, functionalities_removed, functionalities_updated, teams_added, teams_removed, teams_updated, causes_added, causes_removed, causes_updated, timeline_updated, status_page_timeline_updated, role_assignments_updated, role_assignments_added, role_assignments_removed, slack_command, slack_channel_created, slack_channel_converted, microsoft_teams_channel_created, subscribers_updated, subscribers_added, subscribers_removed, user_joined_slack_channel, user_left_slack_channel
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/workflow_post_mortem.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ Optional:
- `incident_condition_visibility` (String) Value must be one off `IS`, `ANY`, `CONTAINS`, `CONTAINS_ALL`, `CONTAINS_NONE`, `NONE`, `SET`, `UNSET`.
- `incident_conditional_inactivity` (String)
- `incident_inactivity_duration` (String) ex. 10 min, 1h, 3 days, 2 weeks
- `incident_kinds` (List of String) Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`.
- `incident_kinds` (List of String) Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`, `scheduled_sub`.
- `incident_post_mortem_condition` (String) Value must be one off `ALL`, `ANY`, `NONE`.
- `incident_post_mortem_condition_cause` (String) [DEPRECATED] Use incident_condition_cause instead. Value must be one off `IS`, `ANY`, `CONTAINS`, `CONTAINS_ALL`, `CONTAINS_NONE`, `NONE`, `SET`, `UNSET`.
- `incident_post_mortem_condition_status` (String) Value must be one off `IS`, `ANY`, `CONTAINS`, `CONTAINS_ALL`, `CONTAINS_NONE`, `NONE`, `SET`, `UNSET`.
- `incident_post_mortem_statuses` (List of String) Value must be one of `draft`, `published`.
- `incident_statuses` (List of String) Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `planning`, `scheduled`, `in_progress`, `verifying`, `completed`.
- `incident_statuses` (List of String) Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `scheduled`, `in_progress`, `completed`.
- `incident_visibilities` (List of String)
- `trigger_type` (String) Value must be one off `post_mortem`.
- `triggers` (List of String) Actions that trigger the workflow. One of custom_fields.<slug>.updated, post_mortem_created, post_mortem_updated, status_updated, slack_command
Expand Down
5 changes: 5 additions & 0 deletions docs/resources/workflow_task_create_openai_chat_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ Required:

Optional:

- `max_tokens` (String) Maximum number of tokens to generate in the response
- `reasoning_effort` (String) Constrains effort on reasoning for GPT-5 and o-series models. Value must be one of `minimal`, `low`, `medium`, `high`.
- `reasoning_summary` (String) Summary of the reasoning performed by the model for GPT-5 and o-series models. Value must be one of `auto`, `concise`, `detailed`.
- `system_prompt` (String) The system prompt to send to OpenAI (optional)
- `task_type` (String)
- `temperature` (Number) Controls randomness in the response. Higher values make output more random
- `top_p` (Number) Controls diversity via nucleus sampling. Lower values make output more focused

## Import

Expand Down
68 changes: 68 additions & 0 deletions docs/resources/workflow_task_create_sub_incident.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
page_title: "Resource rootly_workflow_task_create_sub_incident - terraform-provider-rootly"
subcategory: Workflow Tasks
description: |-
Manages workflow create_sub_incident task.
---

# Resource (rootly_workflow_task_create_sub_incident)

Manages workflow create_sub_incident task.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `task_params` (Block List, Min: 1, Max: 1) The parameters for this workflow task. (see [below for nested schema](#nestedblock--task_params))
- `workflow_id` (String) The ID of the parent workflow

### Optional

- `enabled` (Boolean) Enable/disable this workflow task
- `name` (String) Name of the workflow task
- `position` (Number) The position of the workflow task (1 being top of list)
- `skip_on_failure` (Boolean) Skip workflow task if any failures

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--task_params"></a>
### Nested Schema for `task_params`

Required:

- `title` (String) The sub incident title

Optional:

- `summary` (String) The sub incident summary
- `task_type` (String)

## Import

rootly_workflow_task_create_sub_incident can be imported using the [`import` command](https://developer.hashicorp.com/terraform/cli/commands/import).

```sh
terraform import rootly_workflow_task_create_sub_incident.primary a816421c-6ceb-481a-87c4-585e47451f24
```

Or using an [`import` block](https://developer.hashicorp.com/terraform/language/import).

```terraform
import {
to = rootly_workflow_task_create_sub_incident.primary
id = "a816421c-6ceb-481a-87c4-585e47451f24"
}
```

Locate the resource id in the web app, or retrieve it by listing resources through the API if it's not visible in the web app.

HCL can be generated from the import block using the `-generate-config-out` flag.

```sh
terraform plan -generate-config-out=generated.tf
```
2 changes: 1 addition & 1 deletion docs/resources/workflow_task_publish_incident.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Required:

- `incident` (Map of String) Map must contain two fields, `id` and `name`.
- `public_title` (String)
- `status` (String) Value must be one of `investigating`, `identified`, `monitoring`, `resolved`, `planning`, `scheduled`, `in_progress`, `verifying`, `completed`, `cancelled`.
- `status` (String) Value must be one of `investigating`, `identified`, `monitoring`, `resolved`, `scheduled`, `in_progress`, `completed`.
- `status_page_id` (String)

Optional:
Expand Down
1 change: 1 addition & 0 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func New(version string) func() *schema.Provider {
"rootly_workflow_task_create_google_meeting": resourceWorkflowTaskCreateGoogleMeeting(),
"rootly_workflow_task_create_go_to_meeting": resourceWorkflowTaskCreateGoToMeeting(),
"rootly_workflow_task_create_incident": resourceWorkflowTaskCreateIncident(),
"rootly_workflow_task_create_sub_incident": resourceWorkflowTaskCreateSubIncident(),
"rootly_workflow_task_create_incident_postmortem": resourceWorkflowTaskCreateIncidentPostmortem(),
"rootly_workflow_task_create_jira_issue": resourceWorkflowTaskCreateJiraIssue(),
"rootly_workflow_task_create_jira_subtask": resourceWorkflowTaskCreateJiraSubtask(),
Expand Down
24 changes: 12 additions & 12 deletions provider/resource_alert_route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccResourceAlertRoute(t *testing.T) {
resName := "rootly_alert_route.test"
resName := "rootly_alert_route.test"

resource.UnitTest(t, resource.TestCase{
IsUnitTest: false,
Expand Down Expand Up @@ -40,17 +40,17 @@ func TestAccResourceAlertRoute(t *testing.T) {
resource.TestCheckResourceAttr(resName, "rules.0.fallback_rule", "false"),
),
},
{
ResourceName: resName,
ImportState: true,
{
ResourceName: resName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccResourceAlertRouteWithMultipleTeams(t *testing.T) {
resName := "rootly_alert_route.multi_team"
resName := "rootly_alert_route.multi_team"

resource.UnitTest(t, resource.TestCase{
IsUnitTest: false,
Expand All @@ -67,17 +67,17 @@ func TestAccResourceAlertRouteWithMultipleTeams(t *testing.T) {
resource.TestCheckResourceAttrSet(resName, "id"),
),
},
{
ResourceName: resName,
ImportState: true,
{
ResourceName: resName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccResourceAlertRouteDisabled(t *testing.T) {
resName := "rootly_alert_route.disabled"
resName := "rootly_alert_route.disabled"

resource.UnitTest(t, resource.TestCase{
IsUnitTest: false,
Expand All @@ -94,9 +94,9 @@ func TestAccResourceAlertRouteDisabled(t *testing.T) {
resource.TestCheckResourceAttrSet(resName, "id"),
),
},
{
ResourceName: resName,
ImportState: true,
{
ResourceName: resName,
ImportState: true,
ImportStateVerify: true,
},
},
Expand Down
6 changes: 3 additions & 3 deletions provider/resource_alert_routing_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ func resourceAlertRoutingRule() *schema.Resource {

"target_id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Required: false,
Optional: true,
Computed: false,
Required: true,
Optional: false,
Sensitive: false,
ForceNew: false,
WriteOnly: false,
Expand Down
28 changes: 14 additions & 14 deletions provider/resource_override_shift.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ func resourceOverrideShift() *schema.Resource {
Description: "Override metadata",
},

"user": &schema.Schema{
Type: schema.TypeMap,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Computed: true,
Required: false,
Optional: true,
Description: "User metadata",
"user_id": &schema.Schema{
Type: schema.TypeInt,
Computed: false,
Required: true,
Optional: false,
Sensitive: false,
ForceNew: false,
WriteOnly: false,
Description: "Override shift user",
},
},
}
Expand Down Expand Up @@ -130,8 +130,8 @@ func resourceOverrideShiftCreate(ctx context.Context, d *schema.ResourceData, me
if value, ok := d.GetOkExists("shift_override"); ok {
s.ShiftOverride = value.(map[string]interface{})
}
if value, ok := d.GetOkExists("user"); ok {
s.User = value.(map[string]interface{})
if value, ok := d.GetOkExists("user_id"); ok {
s.UserId = value.(int)
}

res, err := c.CreateOverrideShift(s)
Expand Down Expand Up @@ -168,7 +168,7 @@ func resourceOverrideShiftRead(ctx context.Context, d *schema.ResourceData, meta
d.Set("ends_at", item.EndsAt)
d.Set("is_override", item.IsOverride)
d.Set("shift_override", item.ShiftOverride)
d.Set("user", item.User)
d.Set("user_id", item.UserId)

return nil
}
Expand Down Expand Up @@ -197,8 +197,8 @@ func resourceOverrideShiftUpdate(ctx context.Context, d *schema.ResourceData, me
if d.HasChange("shift_override") {
s.ShiftOverride = d.Get("shift_override").(map[string]interface{})
}
if d.HasChange("user") {
s.User = d.Get("user").(map[string]interface{})
if d.HasChange("user_id") {
s.UserId = d.Get("user_id").(int)
}

_, err := c.UpdateOverrideShift(d.Id(), s)
Expand Down
4 changes: 2 additions & 2 deletions provider/resource_workflow_action_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func resourceWorkflowActionItem() *schema.Resource {
Computed: true,
Required: false,
Optional: true,
Description: "Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`.",
Description: "Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`, `scheduled_sub`.",
},

"incident_statuses": &schema.Schema{
Expand All @@ -207,7 +207,7 @@ func resourceWorkflowActionItem() *schema.Resource {
Computed: true,
Required: false,
Optional: true,
Description: "Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `planning`, `scheduled`, `in_progress`, `verifying`, `completed`.",
Description: "Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `scheduled`, `in_progress`, `completed`.",
},

"incident_inactivity_duration": &schema.Schema{
Expand Down
4 changes: 2 additions & 2 deletions provider/resource_workflow_incident.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func resourceWorkflowIncident() *schema.Resource {
Computed: true,
Required: false,
Optional: true,
Description: "Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`.",
Description: "Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`, `scheduled_sub`.",
},

"incident_statuses": &schema.Schema{
Expand All @@ -207,7 +207,7 @@ func resourceWorkflowIncident() *schema.Resource {
Computed: true,
Required: false,
Optional: true,
Description: "Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `planning`, `scheduled`, `in_progress`, `verifying`, `completed`.",
Description: "Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `scheduled`, `in_progress`, `completed`.",
},

"incident_inactivity_duration": &schema.Schema{
Expand Down
4 changes: 2 additions & 2 deletions provider/resource_workflow_post_mortem.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func resourceWorkflowPostMortem() *schema.Resource {
Computed: true,
Required: false,
Optional: true,
Description: "Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`.",
Description: "Value must be one of `test`, `test_sub`, `example`, `example_sub`, `normal`, `normal_sub`, `backfilled`, `scheduled`, `scheduled_sub`.",
},

"incident_statuses": &schema.Schema{
Expand All @@ -207,7 +207,7 @@ func resourceWorkflowPostMortem() *schema.Resource {
Computed: true,
Required: false,
Optional: true,
Description: "Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `planning`, `scheduled`, `in_progress`, `verifying`, `completed`.",
Description: "Value must be one of `in_triage`, `started`, `detected`, `acknowledged`, `mitigated`, `resolved`, `closed`, `cancelled`, `scheduled`, `in_progress`, `completed`.",
},

"incident_inactivity_duration": &schema.Schema{
Expand Down
Loading