Hi, I’m making a sensor to detect rules with certain tags. I don’t want to use the API, because I would have to change the authentication parameters every time someone tries this plugin.
As you can see what I do is take all the active rules with the sensor context.
And I use the RuleFinder so that it searches for the rule by the key and can assign it to a rule. With that I could already take his name, his tags etc.
But the problem is in the RuleFinder, which says that it is null.
I have tried without the Autowired annotation, with the annotation, putting @Component in this class. And it doesn’t work for me either.
Also, have you considered that context.activeRules().findAll() may be returning an empty collection? I don’t see any length or nullness checks in there…
The collection comes to me with information. Because I have tried to print the rules in this way rule.ruleKey().rule() and it prints all the rules in this way: S6295,S6294…
I have also seen that the ruleFinder is deprecated.
How could I then get the tags from the rules? Without making API calls.