Post

3 followers Follow
0

How to automate QR's deactivation

It's possible that you want to disable a specific quality rule for all the analyzed applications, the manual manipulation can take a long time because for each application you will need to open the assessment model, search the QR, deactivated it then perform a synchronization. If you have 100 application then the operation can take 500 min! 

This topic provides you the steps to perform the deactivation via queries, so for each triplet you need to run the following:

 

1. On the management schema:

update cms_am_qual_rulesset
active = 0
where metric_id = <QR ID>

2. On the local and central schema:

update sys_site
set tree_ref_date = '1900-01-01 00:00:00';

Please sign in to leave a comment.

5 comments

0
Avatar

Thank you Amine.

Could you please also provide the below queries :

1/ Sometimes we don't disable rules, in order to still see the rule violation in the dashboard and not have an impact on health factors, we set the rule weight to 0 and remove the critical contributions, if any.

2/ And also when we upgrade to new version without enabling the new rules, we want after sometime to enable them. Do we need in this case just to use the same above query with "set active = 1" ?

0 votes
Comment actions Permalink
0
Avatar

Hi Mehdi,

If I understand your first query, I would exclude all the violated objects from this QR as follow - https://help.castsoftware.com/hc/en-us/community/posts/360026113813-How-to-exclude-violations-based-on-a-common-condition-

 

For the second query, you should set  "set active = 1" but also to force the synchronization with the following on KB and CB:

update sys_site
set tree_ref_date = '1900-01-01 00:00:00';

0 votes
Comment actions Permalink
0
Avatar

Hi Amine,

In second query, what is "tree_ref_date" ?

Is the value given to that column is a constant or it varies?

Thanks

0 votes
Comment actions Permalink