create_project_rule
Add a rule to a project: when an issue enters 'status', append 'template' to its description. A rule appends its checklist to an issue's description when the issue ENTERS the rule's state — from the board, the Jira API or update_issue alike. The block starts with a hidden marker line '[//]: # (pm-rule:)'; while that line is in the description, entering the state again adds nothing (the journal says 'alreadyThere'). A [~username] in the template is a mention: that person is notified when the checklist lands. A checklist that would make the description too long is not added and the journal says 'tooLong'; the move itself still happens. A rule with action 'agent' is a DUTY instead: it says which issues may be handed to an agent role (agentRole, e.g. 'product') and what the agent may do with them. Its 'template' is then the INSTRUCTION — what doing such an issue means in this project — and nothing is appended anywhere. A duty may have no state (pass an empty 'status'): then an issue is handed only by a person. agentActions is a list from: describe, subtasks, ask, wiki, report, support. agentFields names the fields it may set: priority, labels, duedate, or the project's own fields by name. doneStatus is the state it moves the issue to when done — never a finished one. capUsd raises what one task may cost, up to 5 dollars. Commenting is always allowed; finishing, deleting, reassigning and anything outside the issue never are. Saving or switching on a duty makes it yours: it runs on your behalf and access, and is switched off if you lose the project. The state and the type are NAMES of this project's own (list_project_rules lists them); an unknown one is refused with the list. Project lead or admin only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | What the rule is called, e.g. 'Document pack'. At most 120 characters. | |
| type | No | Only issues of this type, by name, e.g. 'Bug'. Leave out for any type. | |
| label | No | Only issues carrying this label (one word). Leave out for any label. | |
| action | No | 'checklist' (the default) or 'agent' for a duty. Fixed once the rule exists. | |
| capUsd | No | For a duty: what one task may cost, in dollars, when more than the ordinary ceiling is needed. At most 5. | |
| status | Yes | The state whose ENTRY fires the rule, by name, e.g. 'Ready for review'. For a duty taken only by hand, an empty string. | |
| enabled | No | Whether the rule is on from the start. Default true. | |
| template | Yes | The checklist, as Markdown: a '### Heading' per group, '- [ ] item' per line, two spaces of indent to nest an item under another, and [~username] on an item to name who does it. For a duty: the instruction. | |
| agentRole | No | For a duty: the agent role's key, e.g. 'product'. | |
| doneStatus | No | For a duty: the state it moves the issue to when done. Never a finished state. Leave out and it does not move the issue. | |
| projectKey | Yes | Project key, e.g. 'ONB'. | |
| agentFields | No | For a duty: the fields it may set, comma-separated — priority, labels, duedate, or a project field's name. | |
| agentActions | No | For a duty: what the agent may do beyond commenting, comma-separated — describe, subtasks, ask, wiki, report, support. |