We are creating a defect table where we show the number of defects reported in the current sprint and current release (there are 3 sprints in a release). This table sits in the sprint card and is used for sprint reporting.
There is a card tree set up: Release > Sprint > Story > Defect
We have used the following query to get the total number of defects raised in the current release:
value query: SELECT COUNT (*) WHERE 'Team' = 'Stream 2' AND Type = Defect AND ('Defect Reported in Sprint' IS 'Sprint 3.1' OR 'Defect Reported in Sprint' IS 'Sprint 3.2' OR 'Defect Reported in Sprint' IS 'Sprint 3.3')
Is there a better way to express the 'Defect reported in sprint' X AND X And X expression?? I don't want to have to edit my report for each sprint card. I thought I should be able to get the release the current sprint card (THIS CARD) is linked to and use that?
Code Snippet
| - | - |*Comment* |
|*Defects raised in this sprint* |value query: SELECT COUNT (*) WHERE 'Team' = 'Stream 2' AND Type = Defect AND 'Defect Reported in Sprint' = THIS CARD
| - |
|*Defects fixed in this sprint* |value query: SELECT COUNT (*) WHERE 'Team' = 'Stream 2' AND Type = Defect AND 'Defect Fix Completed in Sprint' = THIS CARD
| - |
|*Defects raised in this release*|value query: SELECT COUNT (*) WHERE 'Team' = 'Stream 2' AND Type = Defect AND ('Defect Reported in Sprint' IS 'Sprint 3.1' OR 'Defect Reported in Sprint' IS 'Sprint 3.2' OR 'Defect Reported in Sprint' IS 'Sprint 3.3')
| - |
|*Defects fixed in this release*|value query: SELECT COUNT (*) WHERE 'Team' = 'Stream 2' AND Type = Defect AND ('Defect Fix Completed in Sprint' IS 'Sprint 3.1' OR 'Defect Fix Completed in Sprint' IS 'Sprint 3.2' OR 'Defect Fix Completed in Sprint' IS 'Sprint 3.3')
| - |
|*Total open defects* |value query: SELECT COUNT (*) WHERE 'Team' = 'Stream 2' AND Type = Defect AND NOT 'Defect Environment' = Production AND ('Defect Status' = Open OR 'Defect Status' = 'In Progress')
| - |
Comments
4 comments
If you were just using the sprint parent property in the tree then this would be fairly straightforward because you could also reference the release tree property. You would just need this query:
SELECT count(*) WHERE type=defect and 'tree - release' = THIS CARD.'tree - release'
Since you have 'Defect Fix Completed in Sprint' and 'Defect Reported in Sprint' this is still possible, but a little more complicated:
SELECT count(*) WHERE type=defect AND 'Defect Fix Completed in Sprint' IN (SELECT number WHERE type=sprint AND 'tree - release' = THIS CARD.'tree - release')
This uses two MQL features - THIS CARD.property and the beta nested IN feature. Because you are on the sprint card, you can reference THIS CARD.'tree - release' (or whatever the name of the release property is on the sprint) to get the sprint's release. You can then find all the sprints with that release (sprints 1-3) and use those sprints as the values for the defect's 'Defect Fix Completed in Sprint' property.
Thanks Jay.
We tried the expression suggested with our release property substituted:
{{ value query: SELECT COUNT (*) WHERE 'Team' = 'Stream 2' AND type=defect AND 'Defect Fix Completed in Sprint' IN (SELECT number WHERE type=sprint AND 'release tree - release' = THIS CARD.'release tree - release')}}
However this is giving an error:
Error in value macro using Which? Digital Team project: Card property 'release tree - release' does not exist!
I have attached a screenshot of our release property.
Any further help would be much appreciated (just about to go on leave for a couple of weeks so I my not pick up any response straight away).
Thanks.
Kim
The name of the property is a bit cut off in the screenshot, but it looks like the release property name is just, "release". You don't want to prefix it with the tree name. My example made that a little confusing.
Thanks Jay. I've just picked this up again, amended the code regarding your last comment and got it working.
Kim
Please sign in to leave a comment.