Attributes for creating an incident user-defined field.
category
enum
The section in which the field appears: "what_happened" or "why_it_happened". When null, the field appears in the Attributes section.
Allowed enum values: what_happened,why_it_happened
collected
enum
The lifecycle stage at which the app prompts users to fill out this field. Cannot be set on required fields.
Allowed enum values: active,stable,resolved,completed
default_value
string
The default value for the field. Must be one of the valid values when valid_values is set.
display_name
string
The human-readable name shown in the UI. Defaults to a formatted version of the name if not provided.
name [required]
string
The unique identifier of the field. Must start with a letter or digit and contain only letters, digits, underscores, or periods.
ordinal
string
A decimal string representing the field's display order in the UI.
required
boolean
When true, users must fill out this field on incidents.
tag_key
string
For metric tag-type fields only, the metric tag key that powers the autocomplete options.
type [required]
enum
The data type of the field. 1=dropdown, 2=multiselect, 3=textbox, 4=textarray, 5=metrictag, 6=autocomplete, 7=number, 8=datetime.
Allowed enum values: 1,2,3,4,5,6,7,8
valid_values
[object]
The list of allowed values for dropdown and multiselect fields. Limited to 1000 values.
description
string
A detailed description of the valid value.
display_name [required]
string
The human-readable display name for this value.
short_description
string
A short description of the valid value.
value [required]
string
The identifier that is stored when this option is selected.
relationships [required]
object
Relationships for creating an incident user-defined field.
incident_type [required]
object
Relationship to an incident type.
data [required]
object
Relationship to incident type object.
id [required]
string
The incident type's ID.
type [required]
enum
Incident type resource type.
Allowed enum values: incident_types
default: incident_types
type [required]
enum
The incident user defined fields type.
Allowed enum values: user_defined_field
Response containing a single incident user-defined field.
Expand All
フィールド
種類
説明
data [required]
object
Data object for an incident user-defined field response.
attributes [required]
object
Attributes of an incident user-defined field.
category [required]
enum
The section in which the field appears: "what_happened" or "why_it_happened". When null, the field appears in the Attributes section.
Allowed enum values: what_happened,why_it_happened
collected [required]
enum
The lifecycle stage at which the app prompts users to fill out this field. Cannot be set on required fields.
Allowed enum values: active,stable,resolved,completed
created [required]
date-time
Timestamp when the field was created.
default_value [required]
string
The default value for the field.
deleted [required]
date-time
Timestamp when the field was soft-deleted, or null if not deleted.
display_name [required]
string
The human-readable name shown in the UI.
metadata [required]
object
Metadata for autocomplete-type user-defined fields, describing how to populate autocomplete options.
category [required]
string
The category of the autocomplete source.
search_limit_param [required]
string
The query parameter used to limit the number of autocomplete results.
search_params [required]
object
Additional query parameters to include in the search URL.
search_query_param [required]
string
The query parameter used to pass typed input to the search URL.
search_result_path [required]
string
The JSON path to the results in the response body.
search_url [required]
string
The URL used to populate autocomplete options.
modified [required]
date-time
Timestamp when the field was last modified.
name [required]
string
The unique identifier of the field.
ordinal [required]
string
A decimal string representing the field's display order in the UI.
required [required]
boolean
When true, users must fill out this field on incidents.
reserved [required]
boolean
When true, this field is reserved for system use and cannot be deleted.
tag_key [required]
string
For metric tag-type fields only, the metric tag key that powers the autocomplete options.
type [required]
int32
The data type of the field. 1=dropdown, 2=multiselect, 3=textbox, 4=textarray, 5=metrictag, 6=autocomplete, 7=number, 8=datetime.
valid_values [required]
[object]
The list of allowed values for dropdown, multiselect, and autocomplete fields.
description
string
A detailed description of the valid value.
display_name [required]
string
The human-readable display name for this value.
short_description
string
A short description of the valid value.
value [required]
string
The identifier that is stored when this option is selected.
id [required]
string
The unique identifier of the user-defined field.
relationships [required]
object
Relationships of an incident user-defined field.
created_by_user [required]
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
incident_type [required]
object
Relationship to an incident type.
data [required]
object
Relationship to incident type object.
id [required]
string
The incident type's ID.
type [required]
enum
Incident type resource type.
Allowed enum values: incident_types
default: incident_types
last_modified_by_user [required]
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type [required]
enum
The incident user defined fields type.
Allowed enum values: user_defined_field
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create an incident user-defined field returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createIncidentUserDefinedField"]=true;constapiInstance=newv2.IncidentsApi(configuration);constparams: v2.IncidentsApiCreateIncidentUserDefinedFieldRequest={body:{data:{attributes:{category:"what_happened",collected:"active",defaultValue:"critical",displayName:"Root Cause",name:"root_cause",ordinal:"1.5",required: false,tagKey:"datacenter",type:3,validValues:[{description:"A critical severity incident.",displayName:"Critical",shortDescription:"Critical",value:"critical",},],},relationships:{incidentType:{data:{id:"00000000-0000-0000-0000-000000000000",type:"incident_types",},},},type:"user_defined_field",},},};apiInstance.createIncidentUserDefinedField(params).then((data: v2.IncidentUserDefinedFieldResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));