Repository navigation
Closed
Labels
DailyKSv2Skip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.
Description
To start with, we will only support GetRules and the rules_ collection in the frontend. This allows us to get all users onto a version of the app that uses rules_ only
Data storage
- We have added a new onyx collection:
rules_<ruleID> - Each rule has the following structure:
{
// For merchant rules, lets hard code this to 'policy'
"scope": "policy" | "account",
"scopeID": "<relevant ID based on the scope, so either the policyID, accountID, or domainAccountID>"
// The triggers for a rule are when the relevant rules run. There must always be 1 trigger, but there can be more. For now, lets just worry
// about CreateTransaction
"triggers": {
"0": "CreateTransaction",
},
// Filters follow the exact same AST format as search. They are infinitely extendable, however, for merchant rules, all we care about right now
// is the 'merchant' filter
"filters": {
"left": {
"left": "merchant",
"operator": "eq" | "neq" | "contains" | "notContains" | "gt" | "gte" | "lt" | "lte",
"right": ["Hello world"],
}
"operator": "and"
"right": {
"left": "category",
"operator": "eq" | "neq" | "contains" | "notContains" | "gt" | "gte" | "lt" | "lte",
"right": ["Hello world"],
},
// The actions that are taken on any expenses that match the filters object above
"actions": {
"0": { "name": "Set", "field": "billable", "value": true},
"1": { "name": "Set", "field": "merchant", "value": "modified merchant"},
"2": { "name": "Set", "field": "category", "value": "category"},
"3": { "name": "Set", "field": "tag", "value": "tag"},
"4": { "name": "Set", "field": "reimbursable", "value": true},
"5": { "name": "Set", "field": "vendorID", "value": "vendorid"},
"6": { "name": "Set", "field": "comment", "value": "mycomment"},
"7": { "name": "Set", "field": "tax", "value": { "field_id_TAX": {"externalID": "taxCode"}}},
}
}When a user creates a merchant rule, we should modify the filters to meet the request of the user, and we should modify the actions to include the fields the user wants to set. The triggers should always be just CreateTransaction for now
API Commands
GetRules - Gets all of the rules that a user has access to. This command takes no params. We return the rules_ collection, which SETs the value.
Note: Any rule that has a CreateTransaction trigger, and at least one Set action is an Expense Default Rule. Lets use that to determine where the rule shows up
Issue Owner
Current Issue Owner: @Krishna2323Metadata
Metadata
Labels
DailyKSv2Skip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.
Activity
Krishna2323 commentedon Sep 26, 2026
@situchan PR is ready for review: #102106
melvin-bot commentedon Oct 2, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
[-][Rules Engine Release 1] Support the `GetRules` command and `rules_` collection[/-][+][Due for payment 2026-10-12] [Rules Engine Release 1] Support the `GetRules` command and `rules_` collection[/+]melvin-bot commentedon Oct 5, 2026
@Krishna2323 / @situchan
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.1-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-10-12. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
melvin-bot commentedon Oct 8, 2026
@Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
JS00001 commentedon Oct 12, 2026
@Krishna2323 are we going to pay this out as a part of the rules work?
JS00001 commentedon Oct 12, 2026
Feel free to reopen if not