Add an action and return its actionId. project.action.add takes no params and doesn't echo the new id; ids are sequential indexes so the new action is the last entry. Use update_action(aid, title=...) to populate fields.
(self)
| 752 | ) |
| 753 | |
| 754 | def add_action(self) -> int: |
| 755 | """ |
| 756 | Add an action and return its actionId. |
| 757 | |
| 758 | project.action.add takes no params and doesn't echo the new id; ids |
| 759 | are sequential indexes so the new action is the last entry. |
| 760 | Use update_action(aid, title=...) to populate fields. |
| 761 | """ |
| 762 | self.command("project.action.add") |
| 763 | actions = self.list_actions() |
| 764 | return actions[-1]["actionId"] if actions else -1 |
| 765 | |
| 766 | def update_action(self, action_id: int, **fields) -> dict: |
| 767 | params = {"actionId": action_id, **fields} |