Make Operational Status dependent on Status field on CMDB_CI. Showing numeric value in dropdown as 2 in Operational status.

Anjana Singh1
Kilo Expert

Numeric value getting set whenever trying to make "Operational Status" field on cmdb_ci dependent on "Status" field. 

Screenshots capture below are from my PDI.

This is OOB install_status field on CI table, I have disable other values as per my requirement.

 

This is OOB Operational Status field where I have added dependent field values of status field.

Dictionary of operational status field

 

 

This is how it is appearing on form

 

 

INCORRECT data and only for "In maintenance" I am facing this issue. any idea how to fix this.

If you save "In Maintenance " on Asset and click save, CI also gets updated but with numeric in drop down

Default value is being taken by system is 2, so above "Non-Operational" is 2 thats why it is showing Label as well. However below ...no label is present thats why it is showing as only 2.

  

4 REPLIES 4

Brad Bowman
Kilo Patron
Kilo Patron

Per your definition, the only valid choice for Operational Status when Status is 'In Maintenance' (3) is 'Repair in Progress' (3).  Since Operational Status has a Default value of 1, the CI Operational status is getting set to 1 when the CI Status changes to In Maintenance by the OOTB script that syncs asset and CI data.  It's showing 1 when I do this on my PDI with your specs, not 2.  You can either remove the Default value on Operational status, or change the dependent value for the choice of this default value.     

Hi Brad,

Thanks for investing time 🙂

So on your PDI, if once you change Status to "Retired" on Asset then same will get updated in Status on Related CI and Operational status will also be retired.

Then from Retire to any other state changes you do then Operational status will automatically go as "Non - Operational" then 2 will appear in drop down.

However I tried to remove default value still 1 is appearing.

 

What I can see is there is some BR or any sort of script running in background which changes Operational status to 1 or 2 i.e. Operational and non operational.

 

find_real_file.png

 

For this, take a look at the OOTB Business Rule named Sync Ops Status for CMDB CI which is running on the cmdb_ci table.  The intent of this is to not leave Ops Status as is when Status changes as it would likely leave an invalid choice in most scenarios, so it's trying to default it to a universal option.  You can copy this rule (so that future upgrades don't skip it) deactivate the OOTB one, then modify the script that it works for your use cases.

Actually I already tried to debug using breakpoints in this BR but breakpoints never come  to this BR.

Also I deactivated this BR still everything was working as is. 😛 dont know whats exact reason behind this behavior.

 

Again thanks for your help and time 🙂