New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Event Rules to process and send data to Scripts using Event Data #15063
base: develop
Are you sure you want to change the base?
Enable Event Rules to process and send data to Scripts using Event Data #15063
Conversation
…process the input data inside the script form
Neither of these FRs have been approved before submitting this PR, and even if they had been, they would each need a separate PR. I understand that it's tempting to save time by combining work, but that also makes effective review and documentation very difficult. I've just marked #14884 as approved and assigned it to you, but please revise the PR to remove the introduction of additional context so that we can focus on its specific goal. |
@jeremystretch, updated the PR, and the changes in the code reflects only the task of passing action_data to the script just like the other methods, i.e the script develop may access the input the same way he access the forms. |
@renatoalmeidaoliveira did you push your changes? I don't see any updates. |
@jeremystretch I may have missundertud what you asked. The changes I've made was: You mean to just pass |
I can put all code inside process_event_rules too, |
…on data to Script
@jeremystretch updated the code to restrict the changes only to process_event_rule inside the Script context. |
Is there a reason why this implementation only affect EventRuleActionChoices.SCRIPT? My use-case is to be able to use more data in a webhook payload than what I get from the default event rule "data" dict. |
@aharrisson imo the implementation should be the same to both Webhoocks and Scripts, giving the user more flexibility to pass data to his actions. |
@renatoalmeidaoliveira , Thank you for the quick reply. |
Currently, if I have an event rule that triggers when an IP address is created, modified, or deleted — it's impossible for the script to know which action triggered it. Will this PR address that? |
@llamafilm short answer, in the implementation of this PR yes. |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken. |
@renatoalmeidaoliveira after reviewing with Jeremy, the jinja2 processing shouldn't be here, the data should just be passed as a json blob without going through jinja2. Can you please update the PR for this? |
Fixes: #14884
Passes Event Rule a jinja2 processed
action_data
to script execution as its input.