Automation of a checkbox depending on different fields

Vortex11
Tera Contributor

I have a button named "Aged" which is checkbox field in the VIT table(sn_vul_vulnerable_item). There is an automation needed for this button on an urgent basis.

 

Fields which are related:

1. Risk Rating : Which populates the Risk rating of the VIT (eg - Critical or High)

2. Remediation Target Rule: Which is working as SLA for remediating the VIT. There are different Remediation target rules for different Risk ratings and asset details(OT or Network-IF)

3. Age field : Which is an OOTB duration type field giving the duration difference between "last opened" field and "currrent actual time".

Function definition : glidefunction:datediff(now(), last_opened)

 

Validation of the requirement is as follows (Kind of pseudo code written):

 

If (Risk Rating = Critical and Last Opened date > 30 days) //all devices
        then AGED = True

Else If (Risk Rating = High and Remedaition Target Rule = "High Risk Rating rule-Network-IF" and Age > 60 days)
                then AGED = True 

Else If (Remedaition Target Rule = "High Risk Rating rule" and Age > 60 days)
                then AGED = True
Else if Remedaition Target Rule = "High Risk Rating rule - OT" and Age >180 days
                then AGED = True

Else if Remedaition Target Rule = "High Risk Rating rule-Network-non-IF" and Age >180 days
                then AGED = True

 

Can anyone help with the architecture of the code or what exactly needs to be done to complete this requirement. Immediate help will be highly appreciated.

 

Thanks and regards,

Nilotpal Bhattacherjee

1 REPLY 1

Mark Manders
Mega Patron

Not knowing the exact tables and fields, writing a script would be difficult, but why not create a flow for this? Your list of conditions looks like something that would be perfect for it. 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark