createServiceRequest(ServiceRequestInput)
getServiceRequest(serviceRequestId)
IndustriesSettings
Industries Object Access by Community License
Access Industries Features Deployed Using Managed Packages
Previous Versions
getServiceRequest(serviceRequestId)Retrieve a persisted service request aggregate, including the anchor, custom attributes, and product attributes, by its catalog request ID or anchor record ID. Map values are returned as raw collections.
63.0
No
public static ConnectApi.ServiceRequestGetOutput getServiceRequest(String serviceRequestId)
Type: String
ID of the service request to fetch.
Type: ConnectApi.ServiceRequestGetOutputRepresentation
Returns the current details of the specified service request.
To use the ServiceAutomationFamily methods, enable Unified Catalog in your org.
Here’s an example that demonstrates how to retrieve a service catalog request using Apex.
1// ID of the service catalog request to retrieve
2String serviceRequestId = '946SB0000009QTAYA2';
3
4ConnectApi.ServiceRequestGetOutput result =
5 ConnectApi.ServiceAutomationFamily.getServiceRequest(serviceRequestId);
6
7// anchor and custom attributes defined for the catalog item
8Map<String, Object> customAttributes = result.customAttributes;
9System.debug('Custom Attributes: ' + customAttributes);
10
11// context record tree
12Map<String, Object> anchor = result.anchor;
13System.debug('Anchor: ' + anchor);
14
15// Product attributes
16Map<String, String> productAttributes = result.productAttributes;
17System.debug('Product Attributes: ' + productAttributes);