This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

How to get the matched criteria values into action as parameters

Hi Stackstorm Team

I am inspired from search operator mentioned in Rules — StackStorm 3.1.0 documentation, i am using search operator to match a specific keyword from trigger which has a list of key:values

payload looks like below

{ ‘issue_fields’: [
{
‘servername’: ‘prodweb1’,
‘servicename’: ‘check_ntp’
},
{
‘servername’: ‘prodapp2’,
‘servicename’: ‘check_tomcat’
}]
}

the trigger & criteria looks good and the rule works fine with some basic action i am using in my scenario. How can i pass the iterating item value info to action when the pattern matches , i need the info to be used inside action as host parameters, i am planning to use the value using jinja. This is for using ansible as my action.ref, nagdash/icinga as my sensor. Please help

Ex:

criteria:
trigger.issue_fields:
type: “search”
# Controls whether all items in the trigger payload must match the child criteria,
# or if any single item matching the child criteria is sufficient
condition: any # <- At least one item must match all child patterns
pattern:
# Here our context is each item of the list
# All of these patterns must match the item for the item to be considered a match
# These are simply other operators applied to each item of the list
item.field_name:
type: “equals”
pattern: “Status”

    item.to_value:
      type: "equals"
      pattern: "Approved"

I would like to send the custom key info to a sample action whenever there is a match