published on Thursday, Oct 8, 2026 by incident-io
published on Thursday, Oct 8, 2026 by incident-io
Manage custom field options.
Single- and multi-select custom fields have a list of all available options, which have a value, and a sort key. The value must be unique to the custom field. For example, you might have an Incident Type custom field, with options “Data breach”, “Performance degradation”, “API downtime”, etc.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as incident from "@incident-io/pulumi";
// Create an Affected Teams custom field that we'll create options against.
const affectedTeams = new incident.CustomField("affected_teams", {
name: "Affected Teams",
description: "The teams that are affected by this incident.",
fieldType: "multi_select",
});
// Create several teams against the parent custom field.
const teams: {[key: string]: incident.CustomFieldOption} = {};
for (const range of Object.entries([
"Payments",
"Dashboard",
"API",
].reduce((__obj, entry) => ({ ...__obj, [entry]: entry }), {})).sort().map(([k, v]) => ({key: k, value: v}))) {
teams[range.key] = new incident.CustomFieldOption(`teams-${range.key}`, {
customFieldId: affectedTeams.id,
value: range.value,
});
}
import pulumi
from typing import Any
import pulumi_incident as incident
# Create an Affected Teams custom field that we'll create options against.
affected_teams = incident.CustomField("affected_teams",
name="Affected Teams",
description="The teams that are affected by this incident.",
field_type="multi_select")
# Create several teams against the parent custom field.
teams: dict[str, incident.CustomFieldOption] = {}
for teams_range in [{"key": k, "value": v} for [k, v] in sorted(({entry: entry for entry in [
Payments,
Dashboard,
API,
]}).items())]:
teams[teams_range['key']] = incident.CustomFieldOption(f"teams-{teams_range['key']}",
custom_field_id=affected_teams.id,
value=teams_range["value"])
package main
import (
"fmt"
"github.com/incident-io/pulumi-incident/sdk/go/incident"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create an Affected Teams custom field that we'll create options against.
affectedTeams, err := incident.NewCustomField(ctx, "affected_teams", &incident.CustomFieldArgs{
Name: pulumi.String("Affected Teams"),
Description: pulumi.String("The teams that are affected by this incident."),
FieldType: pulumi.String("multi_select"),
})
if err != nil {
return err
}
// Create several teams against the parent custom field.
forResult0 := map[string]string{}
for _, entry := range []string{
"Payments",
"Dashboard",
"API",
} {
forResult0[entry] = entry
}
var teams []*incident.CustomFieldOption
for key0, val0 := range forResult0 {
__res, err := incident.NewCustomFieldOption(ctx, fmt.Sprintf("teams-%v", key0), &incident.CustomFieldOptionArgs{
CustomFieldId: affectedTeams.ID().ToIDOutput().ToStringOutput(),
Value: pulumi.String(val0),
})
if err != nil {
return err
}
teams = append(teams, __res)
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Incident = Pulumi.Incident;
return await Deployment.RunAsync(() =>
{
// Create an Affected Teams custom field that we'll create options against.
var affectedTeams = new Incident.CustomField("affected_teams", new()
{
Name = "Affected Teams",
Description = "The teams that are affected by this incident.",
FieldType = "multi_select",
});
// Create several teams against the parent custom field.
var teams = new List<Incident.CustomFieldOption>();
foreach (var range in new[]
{
"Payments",
"Dashboard",
"API",
}.ToDictionary(item => {
var entry = item.Value;
return entry;
}, item => {
var entry = item.Value;
return entry;
}).Select(pair => new { pair.Key, pair.Value }))
{
teams.Add(new Incident.CustomFieldOption($"teams-{range.Key}", new()
{
CustomFieldId = affectedTeams.Id,
Value = range.Value,
}));
}
});
Example coming soon!
resources:
# Create an Affected Teams custom field that we'll create options against.
affectedTeams:
type: incident:CustomField
name: affected_teams
properties:
name: Affected Teams
description: The teams that are affected by this incident.
fieldType: multi_select
# Create several teams against the parent custom field.
teams:
type: incident:CustomFieldOption
properties:
customFieldId: ${affectedTeams.id}
value: ${range.value}
options: {}
pulumi {
required_providers {
incident = {
source = "pulumi/incident"
}
}
}
# Create an Affected Teams custom field that we'll create options against.
resource "incident_customfield" "affected_teams" {
name = "Affected Teams"
description = "The teams that are affected by this incident."
field_type = "multi_select"
}
# Create several teams against the parent custom field.
resource "incident_customfieldoption" "teams" {
for_each = {for entry in ["Payments", "Dashboard", "API"] : entry => entry}
custom_field_id = incident_customfield.affected_teams.id
value = each.value
}
Create CustomFieldOption Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CustomFieldOption(name: string, args: CustomFieldOptionArgs, opts?: CustomResourceOptions);@overload
def CustomFieldOption(resource_name: str,
args: CustomFieldOptionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CustomFieldOption(resource_name: str,
opts: Optional[ResourceOptions] = None,
custom_field_id: Optional[str] = None,
value: Optional[str] = None,
sort_key: Optional[int] = None)func NewCustomFieldOption(ctx *Context, name string, args CustomFieldOptionArgs, opts ...ResourceOption) (*CustomFieldOption, error)public CustomFieldOption(string name, CustomFieldOptionArgs args, CustomResourceOptions? opts = null)
public CustomFieldOption(String name, CustomFieldOptionArgs args)
public CustomFieldOption(String name, CustomFieldOptionArgs args, CustomResourceOptions options)
type: incident:CustomFieldOption
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "incident_custom_field_option" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args CustomFieldOptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CustomFieldOptionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CustomFieldOptionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CustomFieldOptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CustomFieldOptionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var customFieldOptionResource = new Incident.CustomFieldOption("customFieldOptionResource", new()
{
CustomFieldId = "string",
Value = "string",
SortKey = 0,
});
example, err := incident.NewCustomFieldOption(ctx, "customFieldOptionResource", &incident.CustomFieldOptionArgs{
CustomFieldId: pulumi.String("string"),
Value: pulumi.String("string"),
SortKey: pulumi.Int(0),
})
resource "incident_custom_field_option" "customFieldOptionResource" {
lifecycle {
create_before_destroy = true
}
custom_field_id = "string"
value = "string"
sort_key = 0
}
var customFieldOptionResource = new CustomFieldOption("customFieldOptionResource", CustomFieldOptionArgs.builder()
.customFieldId("string")
.value("string")
.sortKey(0)
.build());
custom_field_option_resource = incident.CustomFieldOption("customFieldOptionResource",
custom_field_id="string",
value="string",
sort_key=0)
const customFieldOptionResource = new incident.CustomFieldOption("customFieldOptionResource", {
customFieldId: "string",
value: "string",
sortKey: 0,
});
type: incident:CustomFieldOption
properties:
customFieldId: string
sortKey: 0
value: string
CustomFieldOption Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CustomFieldOption resource accepts the following input properties:
- Custom
Field stringId - ID of the custom field this option belongs to
- Value string
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- Sort
Key int - Sort key used to order the custom field options correctly
- Custom
Field stringId - ID of the custom field this option belongs to
- Value string
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- Sort
Key int - Sort key used to order the custom field options correctly
- custom_
field_ stringid - ID of the custom field this option belongs to
- value string
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- sort_
key number - Sort key used to order the custom field options correctly
- custom
Field StringId - ID of the custom field this option belongs to
- value String
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- sort
Key Integer - Sort key used to order the custom field options correctly
- custom
Field stringId - ID of the custom field this option belongs to
- value string
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- sort
Key number - Sort key used to order the custom field options correctly
- custom_
field_ strid - ID of the custom field this option belongs to
- value str
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- sort_
key int - Sort key used to order the custom field options correctly
- custom
Field StringId - ID of the custom field this option belongs to
- value String
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- sort
Key Number - Sort key used to order the custom field options correctly
Outputs
All input properties are implicitly available as output properties. Additionally, the CustomFieldOption resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing CustomFieldOption Resource
Get an existing CustomFieldOption resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CustomFieldOptionState, opts?: CustomResourceOptions): CustomFieldOption@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
custom_field_id: Optional[str] = None,
sort_key: Optional[int] = None,
value: Optional[str] = None) -> CustomFieldOptionfunc GetCustomFieldOption(ctx *Context, name string, id IDInput, state *CustomFieldOptionState, opts ...ResourceOption) (*CustomFieldOption, error)public static CustomFieldOption Get(string name, Input<string> id, CustomFieldOptionState? state, CustomResourceOptions? opts = null)public static CustomFieldOption get(String name, Output<String> id, CustomFieldOptionState state, CustomResourceOptions options)resources: _: type: incident:CustomFieldOption get: id: ${id}import {
to = incident_custom_field_option.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Custom
Field stringId - ID of the custom field this option belongs to
- Sort
Key int - Sort key used to order the custom field options correctly
- Value string
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- Custom
Field stringId - ID of the custom field this option belongs to
- Sort
Key int - Sort key used to order the custom field options correctly
- Value string
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- custom_
field_ stringid - ID of the custom field this option belongs to
- sort_
key number - Sort key used to order the custom field options correctly
- value string
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- custom
Field StringId - ID of the custom field this option belongs to
- sort
Key Integer - Sort key used to order the custom field options correctly
- value String
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- custom
Field stringId - ID of the custom field this option belongs to
- sort
Key number - Sort key used to order the custom field options correctly
- value string
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- custom_
field_ strid - ID of the custom field this option belongs to
- sort_
key int - Sort key used to order the custom field options correctly
- value str
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
- custom
Field StringId - ID of the custom field this option belongs to
- sort
Key Number - Sort key used to order the custom field options correctly
- value String
- Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.
Package Details
- Repository
- incident incident-io/pulumi-incident
- License
- MIT
- Notes
- This Pulumi package is based on the
incidentTerraform Provider.
published on Thursday, Oct 8, 2026 by incident-io