cmdb_service_ci MOA

Jeff W NZAO B
Mega Guru

Hi 

 

I created a script include, where by i try to put the result of my business_service.u_moa_sponsor value. I put it in a bracket "u_moa_sponsor: [],"

here is the code :

 

 

else if (lineCond.startsWith('business_service.u_moa_sponsorSTARTSWITH')) {
                            // Extraire la valeur après 'business_service.u_moa_sponsorSTARTSWITH'
                            var valueMOA = lineCond.split('business_service.u_moa_sponsorSTARTSWITH')[1].trim();
                            var moaGR = new GlideRecord('cmdb_ci_service');
			moaGR.addQuery('u_moa_sponsor', 'STARTSWITH', valueMOA);
                            moaGR.query();

                            while (moaGR.next()) {
                                rule['u_moa_sponsor'].push(moaGR.getValue('sys_id'));

                                    // Journaliser pour débogage
                                    gs.log('MOA Sponsor trouvé : ' + moaGR.getValue('sys_id') + ' pour la valeur : ' + valueMOA, 'MOA');
                                
                            }
						}

 

 

 

 

And from my client script onchange, i just set the value to a specific field :

here is the code within the parse function, i just removed all details :

 

var u_moa_sponsor = rule.u_moa_sponsor;

 g_form.setValue('v_commanditaire', u_moa_sponsor);

 

 

The problem is in the script include, i try to read an assigment rule condition. 

Can you please help to get a child information from the 'cmdb_ci_service' : 

business_service.u_moa_sponsorSTARTSWITH DSI IT

DSI IT is one of the value I must get from my value, it can be any which will be defined in the ssignment rule.

Thanks for your feedback
0 REPLIES 0