Przejdź do głównej zawartości

Task rules

A task rule is a script of the Skrypty window that is tied to the tasks of chosen projects. There are three kinds of rules; each shows itself in a different place of QubDesk.

Three kinds of rules​

KindWhen it worksWhat you see in QubDesk
On a task eventAfter a chosen event happens to a task of a chosen project.The changes the script makes appear in the task and its history.
Transition checkBefore the state of a task changes.A change the check refuses leaves the state as it was, and the reason is shown to you.
Task card actionWhen someone presses an item of the "…" menu of the card.The item with the name of the rule in the menu of the card.

A rule on a task event​

The events are Task created, Task changed, Task commented, Task linked, Task moved to another project, Task deleted, Task restored, Status change and Card action pressed. For Task changed the list Only when these fields change narrows the rule to the fields Status, Assignee, Priority, Due, Tags, Title, Custom fields and Parent; Empty — any field.

A change made by the script wakes other rules, and the script itself, only up to the chain length limit. A chain that reaches the limit switches the rule off with a message; an administrator sets the limit in the Qubix settings. A script that fails several times in a row on task events is switched off too.

A transition check​

The check reads the change and can refuse it with a reason, which you see as the message of the refused move or edit. The choice When the check fails says what happens when the script itself breaks or runs out of time: Refuse the transition or Let the transition through. The kind Transition check is offered to people with the right Zarządzanie projektami zadań. Inside a check the script only reads data. A check applies wherever a state changes: the card, the board, the bulk bar, moving a task, the automatic closing of a parent and an import that runs the rules.

An action in the card​

The item carries the name of the script in the "…" menu of the card (see The task card). A press runs the script on that task; if the run fails, the message shows the error text, or, when the text is empty, the result: przekroczono czas, błąd, błąd kompilacji or pominięto. For a script of this kind the section shows the state Not approved: only the author sees the menu item. or Approved by an administrator: everyone who sees the task sees the menu item, if the author sees it too., and an administrator sees the button Approve for everyone / Revoke the approval. The approval belongs to the text that was approved: after the script is changed, the approval is withdrawn until an administrator approves it again.

Set up a rule​

  1. Open the window Skrypty and a script (or create one). The section Task rule is shown where the QubDesk section is available.
  2. Choose the Rule kind. The choice Not a task rule leaves the script as an ordinary one.
  3. Choose the Projects — the rule works on their tasks only.
  4. For a rule on a task event choose the Events and, if you need it, the fields; for a transition check choose what happens when the check fails.
  5. Save the script. A short hint under the section repeats what the kind does.

Where you see the rules in QubDesk​

  • In Project settings, the block Task rules lists the rules of the project: the name (a click opens the script where the Scripts window is available), the kind (on a task event, transition check or card action), the owner, and the word off for a rule that is off. An empty block says Jeszcze nic
  • In the "…" menu of a card, the items of the card actions.
  • In an import, the switch Run project task rules decides whether the rules work on the imported tasks.

What's next​