Change Value based on change of another field

govardhantv
Kilo Contributor

Hi All,

We have change table in that we have two fields ."ci "is reference field(cmdb_ci) and "type" is string with four values(standard,comprehensive,stable and delay)

,now we have a requirement that when ever type of ci is corporate then only then only in the "type "field we need to get the option "stable"other wise "type"field should populate only three dropdown values.

find_real_file.png

Warm Regards

Govardhan

1 ACCEPTED SOLUTION

india
Tera Guru

Hi,



Go to UI policy and select



condition: configuration item is corporate



in advance mode



run script this



if true


g_form.setValue('your field name','stable);


g_form.removeOption('your_field_name, 'value of   standard');//add choices as per requirement


g_form.removeOption('your_field_name, 'value of ,comprehensive'   )


g_form.removeOption('your_field_name, 'value of   delay')



if false


g_form.removeOption('your_field_name','value of stable');




value of choice get by right click on choice and click on Show Choice list.



Mark as:   LIKE/Correct/Helpful




View solution in original post

8 REPLIES 8

Hi,



I have given != (not equal to) operator in the if statement, which means if the ci is not corporate then only it will remove the option stable, otherwise it will show it. Also, in place of 'corporate' you need to specify the sys_id of corporate ci.



Regards,


Prajakta


Thank you for the reply ,


corporate is not ci ,but it is type of ci,if i have ci type as corporate then i have to get the stable option in the "type"field.


india
Tera Guru

Hi,



Go to UI policy and select



condition: configuration item is corporate



in advance mode



run script this



if true


g_form.setValue('your field name','stable);


g_form.removeOption('your_field_name, 'value of   standard');//add choices as per requirement


g_form.removeOption('your_field_name, 'value of ,comprehensive'   )


g_form.removeOption('your_field_name, 'value of   delay')



if false


g_form.removeOption('your_field_name','value of stable');




value of choice get by right click on choice and click on Show Choice list.



Mark as:   LIKE/Correct/Helpful




india
Tera Guru

Pls mark as helpful if you think so



;-)kirtesh