The Zurich release has arrived! Interested in new features and functionalities? Click here for more

if i select the business service xyz[prod] then auto set the enviroment is prod.

Rajan Kumar5
Tera Contributor

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.

RajanKumar5_0-1693335576961.png

 

1 REPLY 1

SN_Learn
Kilo Patron
Kilo Patron

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);
    }

}

 

SN_Learn_0-1693342099954.png

 

Kindly consider marking the provided answer as correct if it proves helpful.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.