Set default value for cmdb_ci fields

ebaileyybs
Tera Expert

Hi,

We have a requirement to add a default value for 3 fields on a bespoke table we have created.

The fields are used across different CI tables and therefore the default value should only be set for a specific table.

The fields are;

u_ci_overview

support_group

owned_by

The table is u_ad_folder_access.

Could this be done via a dictionary override?

Thanks,

Emma

1 ACCEPTED SOLUTION

suri
Kilo Expert

Hi Emma,


We can set default values through Dictionary Overrides.


for example:


if a field is present in the task table and the table is extended to incident table,so we can set default value for task and as well as incident by clicking on the dictioanry overrides present in the configure dictionary and select the require table and set the default value.



right click on field select configure dictionary--> dictionary overrides --> select table and click on check box of override default value.



PS: Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

2 REPLIES 2

sudharsanv36
Kilo Guru

Solution 1:


Create an Business Rule (OnBefore Insert).



On the condition check the " current.sys_class_name == 'u_ad_folder_access' "



On the Script end:


current.u_ci_overview = 'desired_value';


current.support_group = 'desired_value';


current.owned_by = 'desired_value';



Solution 2:



Call a script include and send current record as the parameter.



If it matches with the CI class name, return the default values.



Hope this helps.


suri
Kilo Expert

Hi Emma,


We can set default values through Dictionary Overrides.


for example:


if a field is present in the task table and the table is extended to incident table,so we can set default value for task and as well as incident by clicking on the dictioanry overrides present in the configure dictionary and select the require table and set the default value.



right click on field select configure dictionary--> dictionary overrides --> select table and click on check box of override default value.



PS: Hit like, Helpful or Correct depending on the impact of the response