Project variables allow you to specify in one place a value which can then be referenced in many places within your Mingle project. Using a project variable instead of hard-coding a specific value means that value can be changed in one place and immediately the new value will be reflected throughout the project.
Any time you find yourself entering a constant into a MQL query, it's worth considering if it might be better to use a project variable instead. This is especially likely if you find yourself using the same constant in several places.
How and where to use project variables
There are multiple areas where you can use a project variable as a value of a property:
Project variables can be assigned to card properties in card transitions, e.g. Transition 'Planning - Iteration' might update a card's iteration number property to equal the project variable called 'Current Iteration'.
Project variables are available on the pop ups we provide when a transition sets (user input required) or (user input optional) as a property value.
Project variables can be referenced as constants from within MQL queries, e.g.
'Iteration Number' = (Current Iteration)
where 'Iteration Number' is a numeric property and (Current Iteration) is numeric type project variable. This example applies to other data types, but please note -
To use tree relationship type project variables in MQL, i.e. the data type for the project variable is one of the card types used in a tree's configuration, its name needs to be inside of single quotes.
'Planning - Iteration' = ('Current Planning Iteration')
where 'Planning - Iteration' is a tree relationship property in the 'Release - Iteration - Story' tree, and 'Current Planning Iteration' is an Iteration type project variable.
Project variables are available for use in card defaults. For example, you may want all newly created cards to be added to the current iteration. This can be accomplished by setting 'Planning - Iteration' to a project variable called 'Current Iteration'.
Project variables are available on the card view. When a property is associated to a project variable, the project variable is available as a possible value for that property.
Bulk editor on card list views
Project variables are available on the card bulk editor on the list view. As soon as you choose a project variable as a value for a property, the value of the project variable will be applied to selected card(s) on card list view.
You can create the following types of project variable
- Text - any text value of up to 255 characters in length.
- Numeric - any numeric value.
- Selected from team list - any project team member.
- Date - any date.
- Card - a reference to a card.
Beginning with Mingle 2.3, project variables are available as values for most existing parameters for all macro charts. Any project variable data types which match the types of any chart parameters can be used to generate charts. For example, you can use the date project variable called (Release Start Date) in 'x-labels-start' in data series chart.
If you created a new project based on a template, the project may include some project variables by default. You can update or remove any extra project variables as required.
If templates that contain project variables are imported without cards, then any project variable references a specific card, then it will be changed to be (not set).