sensor with parameters
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
When I tried to create a new sensor with an optionnal parameter.
I created a new rule without parameter, it works.
But when I tried to set a parameters, the st2rulesengine doesn't found the rule defined.
My sensor:
---
class_name: "WatchTickets"
entry_point: "watch_tickets.py"
description: "Test sensor that emits triggers."
poll_interval: 30
trigger_types:
- name: "watch_tickets"
description: "An example trigger."
parameters_schema:
type: "object"
properties:
delta:
type: "number"
additionalProperties: false
payload_schema:
type: "object"
properties:
ticket_id:
type: "number"
My rule:
---
name: "rules.merge.watch_tickets"
pack: "example"
description: "Watch open tickets assigned"
enabled: true
trigger:
type: "test.watch_tickets"
parameters:
delta: 15
action:
ref: "core.echo"
parameters:
message: "{{ trigger.ticket_id }}"
Do you have a solution ?
st2 3.7.0, on Python 3.8.10
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the WatchTickets sensor configuration, its watch_tickets.py entry point, and the rules.merge.watch_tickets rule on StackStorm 3.7.0 with Python 3.8.10. Trace how st2rulesengine resolves trigger parameters; done means the parameterized rule is found and the action receives the ticket_id as shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100