Content
View differences
Updated by Tobias Dillmann 12 months ago
**Acceptance criteria:**
* A calculated value is added as a new project attribute
* A calculated value has these details:
* Name
* Formula
* For all projects
* there is no special **permission** for reading or writing calculated values, but be aware of the existing permissions for project attributes
* Usage of calculated values is hidden behind a **feature flag**
* The formulas can include the following attributes from that project:
* Integer
* Float
* List factors (Project attribute of type list with values) <mention class="mention" data-id="50111" data-type="work_package" data-text="###50111">###50111</mention>
* Other calculated values
* Mathematical operators: +, -, \*, /, ( and )
* Constants (numbers that can be typed into the formula)
* **Order of operations:** Automatic application of the mathematical rule where multiplication and division are performed before addition and subtraction, unless parentheses dictate otherwise
* In order to trigger the selection of the attributes in the field, the user can use the command "/" as implemented in the Automatically generated subjects.
* The command triggers a dropdown to open with sections for:
* Mathematical operators
* Custom fields of type integer or float
* List factors
* Calculated values
* The project attribute can be displayed in
* the project overview
* the project list
* Enterprise token is needed in order to
* add new calculated values in the administration
* display calculated values on the project overview page and in the project list
* list calculated values in the API
* Error handling
* In calculations, there is error handling for **circular references**.
* In case the user includes text that is **not an integer or a float,** the field will display an inline error: "Only numeric values, project factors, calculated values and mathematical operators are allowed"
* In case the mathematical operation fails (e.g. because of a **division by zero error**), the field will display an inline error.
* In case a custom field is **Open question**: are the factor list attributes required? If they _could_ be empty, we must consider error handling. For example, if the formula contains any attributes that are not set, deactivated, or otherwise inaccessible for calculations, the field will display an inline error. error: "The attributes foo and bar are not set. Please set all attributes required for the calculation."
* After saving it, the formula is calculated and the result of the calculated value is stored in the database Open questions
* Lots of read access from multiple places.
* Difficulty to calculate a calculated value if it in turn includes a calculated value again.
* Updating a modal showing a calculated value while its factors are being inserted by the user. E.g. a factored list being calculated of 2 custom fields. All are displayed in the same section of the overview page. -> the user opens the modal. inputs first one value, then the second. Then the calculated value is ideally displayed right away (even before the users clicks on `save`).
* \[Technical question\] Is the whole side menu of the overview page displaying the custom fields updated as one or in sections? Relevant for when the calculated value is not in the same section as the values factored in.
* Calculated values are **displayed \[Technical question\] Is the calculated value stored in the activity**
database or calculated on read?
* The activity messages Hypothesis: Displayed in the database. Reasons:
* Lots of read access from float custom field can be reused
multiple places.
* Only show the change from Difficulty to calculate a value not being calculated to the value being calculated (and vice versa). Or if the it in turn includes a calculated value changes.
again.
* e.g. "the value changed from 5 to <error>"
* Open questions
* In which cases is the recalculation triggered? Cases affecting the value:
* A list value of a factor is inserted
* A list value of a factor is deleted
* A list value of a factor is changed
* A calculated value being a factor is recalculated (changed)
* The calculation formula is changed
* **\[open question\]** Is a specific cause mentioned in the project activity?
* maybe a general info text: "the formula has been changed"
* we could also display the new formula as a string
* A custom field being used as a factor is disabled in the project
* A calculated value is activated in a project/in multiple projects at the same time.
* Some of these are bulk actions -> think about using a background job. Cancel a running job if the calculation changes again before the running job completed?
* Calculated values are **displayed in the activity**
* The activity messages from float custom field can be reused
* Only show the change from a value not being calculated to the value being calculated (and vice versa). Or if the calculated value changes.
* e.g. "the value changed from 5 to <error>"
* To make the formula discoverable for non-admins: display a hovercard on the calculated value that displays the formula? formula. If there are errors, color code it to indicate the values already present (blue) and the ones missing (red).
* On the project overview page (attributes section)
* Also within the modal when editing attributes (when you hover over the read-only input field for the calculated value)
* Within the project list
<br>
* A calculated value is added as a new project attribute
* A calculated value has these details:
* Name
* Formula
* For all projects
* there is no special **permission** for reading or writing calculated values, but be aware of the existing permissions for project attributes
* Usage of calculated values is hidden behind a **feature flag**
* The formulas can include the following attributes from that project:
* Integer
* Float
* List factors (Project attribute of type list with values) <mention class="mention" data-id="50111" data-type="work_package" data-text="###50111">###50111</mention>
* Other calculated values
* Mathematical operators: +, -, \*, /, ( and )
* Constants (numbers that can be typed into the formula)
* **Order of operations:** Automatic application of the mathematical rule where multiplication and division are performed before addition and subtraction, unless parentheses dictate otherwise
* In order to trigger the selection of the attributes in the field, the user can use the command "/" as implemented in the Automatically generated subjects.
* The command triggers a dropdown to open with sections for:
* Mathematical operators
* Custom fields of type integer or float
* List factors
* Calculated values
* The project attribute can be displayed in
* the project overview
* the project list
* Enterprise token is needed in order to
* add new calculated values in the administration
* display calculated values on the project overview page and in the project list
* list calculated values in the API
* Error handling
* In calculations, there is error handling for **circular references**.
* In case the user includes text that is **not an integer or a float,** the field will display an inline error: "Only numeric values, project factors, calculated values and mathematical operators are allowed"
* In case the mathematical operation fails (e.g. because of a **division by zero error**), the field will display an inline error.
* In case a custom field is
* After saving it, the formula is calculated and the result of the calculated value is stored in the database
* Lots of read access from multiple places.
* Difficulty to calculate a calculated value if it in turn includes a calculated value again.
* Updating a modal showing a calculated value while its factors are being inserted by the user. E.g. a factored list being calculated of 2 custom fields. All are displayed in the same section of the overview page. -> the user opens the modal. inputs first one value, then the second. Then the calculated value is ideally displayed right away (even before the users clicks on `save`).
* Lots of read access
* Open questions
* In which cases is the recalculation triggered? Cases affecting the value:
* A list value of a factor is inserted
* A list value of a factor is deleted
* A list value of a factor is changed
* A calculated value being a factor is recalculated (changed)
* The calculation formula is changed
* **\[open question\]** Is a specific cause mentioned in the project activity?
* maybe a general info text: "the formula has been changed"
* we could also display the new formula as a string
* A custom field being used as a factor is disabled in the project
* A calculated value is activated in a project/in multiple projects at the same time.
* Some of these are bulk actions -> think about using a background job. Cancel a running job if the calculation changes again before the running job completed?
*
* The activity messages from float custom field can be reused
* Only show the change from a value not being calculated to the value being calculated (and vice versa). Or if the calculated value changes.
* e.g. "the value changed from 5 to <error>"
*
* On the project overview page (attributes section)
* Also within the modal when editing attributes (when you hover over the read-only input field for the calculated value)
* Within the project list
<br>