PagerDuty v4.29.4 published on Friday, Oct 24, 2025 by Pulumi
pagerduty.getServiceCustomFieldValue
Use this data source to get information about service custom field values in PagerDuty.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
// Create a service
const exampleService = new pagerduty.Service("example", {
name: "Example Service",
autoResolveTimeout: "14400",
acknowledgementTimeout: "600",
escalationPolicy: examplePagerdutyEscalationPolicy.id,
});
const example = pagerduty.getServiceCustomFieldValueOutput({
serviceId: exampleService.id,
});
export const environmentValue = example.apply(example => .filter(field => field.name == "environment").map(field => (field.value))[0]);
// Set custom field values on the service
const exampleServiceCustomFieldValue = new pagerduty.ServiceCustomFieldValue("example", {
serviceId: exampleService.id,
customFields: [
{
name: "environment",
value: JSON.stringify("production"),
},
{
name: "region",
value: JSON.stringify("us-east-1"),
},
],
});
import pulumi
import json
import pulumi_pagerduty as pagerduty
# Create a service
example_service = pagerduty.Service("example",
name="Example Service",
auto_resolve_timeout="14400",
acknowledgement_timeout="600",
escalation_policy=example_pagerduty_escalation_policy["id"])
example = pagerduty.get_service_custom_field_value_output(service_id=example_service.id)
pulumi.export("environmentValue", example.apply(lambda example: [field.value for field in example.custom_fields if field.name == "environment"][0]))
# Set custom field values on the service
example_service_custom_field_value = pagerduty.ServiceCustomFieldValue("example",
service_id=example_service.id,
custom_fields=[
{
"name": "environment",
"value": json.dumps("production"),
},
{
"name": "region",
"value": json.dumps("us-east-1"),
},
])
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
return await Deployment.RunAsync(() =>
{
// Create a service
var exampleService = new Pagerduty.Service("example", new()
{
Name = "Example Service",
AutoResolveTimeout = "14400",
AcknowledgementTimeout = "600",
EscalationPolicy = examplePagerdutyEscalationPolicy.Id,
});
var example = Pagerduty.GetServiceCustomFieldValue.Invoke(new()
{
ServiceId = exampleService.Id,
});
// Set custom field values on the service
var exampleServiceCustomFieldValue = new Pagerduty.ServiceCustomFieldValue("example", new()
{
ServiceId = exampleService.Id,
CustomFields = new[]
{
new Pagerduty.Inputs.ServiceCustomFieldValueCustomFieldArgs
{
Name = "environment",
Value = JsonSerializer.Serialize("production"),
},
new Pagerduty.Inputs.ServiceCustomFieldValueCustomFieldArgs
{
Name = "region",
Value = JsonSerializer.Serialize("us-east-1"),
},
},
});
return new Dictionary<string, object?>
{
["environmentValue"] = .Where(field => field.Name == "environment").Select(field =>
{
return field.Value;
}).ToList()[0],
};
});
Example coming soon!
Example coming soon!
Using getServiceCustomFieldValue
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getServiceCustomFieldValue(args: GetServiceCustomFieldValueArgs, opts?: InvokeOptions): Promise<GetServiceCustomFieldValueResult>
function getServiceCustomFieldValueOutput(args: GetServiceCustomFieldValueOutputArgs, opts?: InvokeOptions): Output<GetServiceCustomFieldValueResult>def get_service_custom_field_value(service_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetServiceCustomFieldValueResult
def get_service_custom_field_value_output(service_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetServiceCustomFieldValueResult]func LookupServiceCustomFieldValue(ctx *Context, args *LookupServiceCustomFieldValueArgs, opts ...InvokeOption) (*LookupServiceCustomFieldValueResult, error)
func LookupServiceCustomFieldValueOutput(ctx *Context, args *LookupServiceCustomFieldValueOutputArgs, opts ...InvokeOption) LookupServiceCustomFieldValueResultOutput> Note: This function is named LookupServiceCustomFieldValue in the Go SDK.
public static class GetServiceCustomFieldValue
{
public static Task<GetServiceCustomFieldValueResult> InvokeAsync(GetServiceCustomFieldValueArgs args, InvokeOptions? opts = null)
public static Output<GetServiceCustomFieldValueResult> Invoke(GetServiceCustomFieldValueInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetServiceCustomFieldValueResult> getServiceCustomFieldValue(GetServiceCustomFieldValueArgs args, InvokeOptions options)
public static Output<GetServiceCustomFieldValueResult> getServiceCustomFieldValue(GetServiceCustomFieldValueArgs args, InvokeOptions options)
fn::invoke:
function: pagerduty:index/getServiceCustomFieldValue:getServiceCustomFieldValue
arguments:
# arguments dictionaryThe following arguments are supported:
- Service
Id string - The ID of the service to get custom field values for.
- Service
Id string - The ID of the service to get custom field values for.
- service
Id String - The ID of the service to get custom field values for.
- service
Id string - The ID of the service to get custom field values for.
- service_
id str - The ID of the service to get custom field values for.
- service
Id String - The ID of the service to get custom field values for.
getServiceCustomFieldValue Result
The following output properties are available:
- Custom
Fields List<GetService Custom Field Value Custom Field> - A list of custom field values associated with the service. Each element contains:
- Id string
- The ID of the custom field.
- Service
Id string
- Custom
Fields []GetService Custom Field Value Custom Field - A list of custom field values associated with the service. Each element contains:
- Id string
- The ID of the custom field.
- Service
Id string
- custom
Fields List<GetService Custom Field Value Custom Field> - A list of custom field values associated with the service. Each element contains:
- id String
- The ID of the custom field.
- service
Id String
- custom
Fields GetService Custom Field Value Custom Field[] - A list of custom field values associated with the service. Each element contains:
- id string
- The ID of the custom field.
- service
Id string
- custom_
fields Sequence[GetService Custom Field Value Custom Field] - A list of custom field values associated with the service. Each element contains:
- id str
- The ID of the custom field.
- service_
id str
- custom
Fields List<Property Map> - A list of custom field values associated with the service. Each element contains:
- id String
- The ID of the custom field.
- service
Id String
Supporting Types
GetServiceCustomFieldValueCustomField
- Data
Type string - The kind of data the custom field is allowed to contain. Can be one of:
string,integer,float,boolean,datetime, orurl. - Description string
- A description of the data this field contains.
- Display
Name string - The human-readable name of the custom field.
- Field
Type string - The type of field. Can be one of:
single_value,single_value_fixed,multi_value, ormulti_value_fixed. - Id string
- The ID of the custom field.
- Name string
- The name of the custom field.
- Type string
- The type of the reference, typically <span pulumi-lang-nodejs=""fieldValue"" pulumi-lang-dotnet=""FieldValue"" pulumi-lang-go=""fieldValue"" pulumi-lang-python=""field_value"" pulumi-lang-yaml=""fieldValue"" pulumi-lang-java=""fieldValue"">"field_value".
- Value string
- The value of the custom field. This is a JSON-encoded string matching the field's data type.
- Data
Type string - The kind of data the custom field is allowed to contain. Can be one of:
string,integer,float,boolean,datetime, orurl. - Description string
- A description of the data this field contains.
- Display
Name string - The human-readable name of the custom field.
- Field
Type string - The type of field. Can be one of:
single_value,single_value_fixed,multi_value, ormulti_value_fixed. - Id string
- The ID of the custom field.
- Name string
- The name of the custom field.
- Type string
- The type of the reference, typically <span pulumi-lang-nodejs=""fieldValue"" pulumi-lang-dotnet=""FieldValue"" pulumi-lang-go=""fieldValue"" pulumi-lang-python=""field_value"" pulumi-lang-yaml=""fieldValue"" pulumi-lang-java=""fieldValue"">"field_value".
- Value string
- The value of the custom field. This is a JSON-encoded string matching the field's data type.
- data
Type String - The kind of data the custom field is allowed to contain. Can be one of:
string,integer,float,boolean,datetime, orurl. - description String
- A description of the data this field contains.
- display
Name String - The human-readable name of the custom field.
- field
Type String - The type of field. Can be one of:
single_value,single_value_fixed,multi_value, ormulti_value_fixed. - id String
- The ID of the custom field.
- name String
- The name of the custom field.
- type String
- The type of the reference, typically <span pulumi-lang-nodejs=""fieldValue"" pulumi-lang-dotnet=""FieldValue"" pulumi-lang-go=""fieldValue"" pulumi-lang-python=""field_value"" pulumi-lang-yaml=""fieldValue"" pulumi-lang-java=""fieldValue"">"field_value".
- value String
- The value of the custom field. This is a JSON-encoded string matching the field's data type.
- data
Type string - The kind of data the custom field is allowed to contain. Can be one of:
string,integer,float,boolean,datetime, orurl. - description string
- A description of the data this field contains.
- display
Name string - The human-readable name of the custom field.
- field
Type string - The type of field. Can be one of:
single_value,single_value_fixed,multi_value, ormulti_value_fixed. - id string
- The ID of the custom field.
- name string
- The name of the custom field.
- type string
- The type of the reference, typically <span pulumi-lang-nodejs=""fieldValue"" pulumi-lang-dotnet=""FieldValue"" pulumi-lang-go=""fieldValue"" pulumi-lang-python=""field_value"" pulumi-lang-yaml=""fieldValue"" pulumi-lang-java=""fieldValue"">"field_value".
- value string
- The value of the custom field. This is a JSON-encoded string matching the field's data type.
- data_
type str - The kind of data the custom field is allowed to contain. Can be one of:
string,integer,float,boolean,datetime, orurl. - description str
- A description of the data this field contains.
- display_
name str - The human-readable name of the custom field.
- field_
type str - The type of field. Can be one of:
single_value,single_value_fixed,multi_value, ormulti_value_fixed. - id str
- The ID of the custom field.
- name str
- The name of the custom field.
- type str
- The type of the reference, typically <span pulumi-lang-nodejs=""fieldValue"" pulumi-lang-dotnet=""FieldValue"" pulumi-lang-go=""fieldValue"" pulumi-lang-python=""field_value"" pulumi-lang-yaml=""fieldValue"" pulumi-lang-java=""fieldValue"">"field_value".
- value str
- The value of the custom field. This is a JSON-encoded string matching the field's data type.
- data
Type String - The kind of data the custom field is allowed to contain. Can be one of:
string,integer,float,boolean,datetime, orurl. - description String
- A description of the data this field contains.
- display
Name String - The human-readable name of the custom field.
- field
Type String - The type of field. Can be one of:
single_value,single_value_fixed,multi_value, ormulti_value_fixed. - id String
- The ID of the custom field.
- name String
- The name of the custom field.
- type String
- The type of the reference, typically <span pulumi-lang-nodejs=""fieldValue"" pulumi-lang-dotnet=""FieldValue"" pulumi-lang-go=""fieldValue"" pulumi-lang-python=""field_value"" pulumi-lang-yaml=""fieldValue"" pulumi-lang-java=""fieldValue"">"field_value".
- value String
- The value of the custom field. This is a JSON-encoded string matching the field's data type.
Package Details
- Repository
- PagerDuty pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerdutyTerraform Provider.
