if i select the business service xyz[prod] then auto set the enviroment is prod.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 12:03 PM - edited 08-29-2023 12:05 PM
Hi team,
if I select the business service xyz[prod] then auto-set the environment as prod.
another example: if I select the business service xyz[dev] then auto-set the environment as dev.
anyone, please suggest to me how to configure this thing?
this is catalog item.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 01:50 PM
Hi Rajan,
You can write an onChange catalog client script for this :
onChange Variable Name will be Business Services
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var getService = g_form.getDisplayValue('business_services');
var regexp = /\[([^\]]+)\]/;
var text = getService.match(regexp);
if (text && text.length > 1) {
var extract = text[1];
var setEnvName = g_form.setValue('environment_name',extract);
}
}
Kindly consider marking the provided answer as correct if it proves helpful.
----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.
Mark this as Helpful / Accept the Solution if this helps.