MQL Syntax question

Follow

Comments

5 comments

  • Avatar
    Jay Mitchell

    That looks really close. Try changing COUNT(*) to "Start Date" in the MQL.

  • Avatar
    Ariel

    Hi Jay,


    I think that not fix my problem. For example the Count(*) query is always returning 0. I think the problem resides in the where clauses.


    WHERE Type = Iteration AND Iteration = (Current Iteration)


    that kind of query works very good for stories... for example:


    WHERE Type = Story AND Iteration = (Current Iteration)


    Thoughts?


    Thanks again,


    Ariel.

  • Avatar
    Jay Mitchell

    I see. I misunderstood your initial intention. Currently there is no way in MQL to use a card project variable to get values for the card that is assigned to the project variable. (Which is just a long way of saying that we can't get the start date for the current iteration.) I've added that story to our project backlog.


    For now your best options are to either to type in the date directly (if you only need that in one place) or create a project variable that contains either the start date or the iteration card number (if you need that start date in more than one place).



    • If you create a project variable with the start date you can use the project variable macro to get the start date.



    • If you create a project variable with the iteration card number you can use the value macro to get the start date (and any other properties from the current iteration that you would like). E.g., SELECT 'start date' WHERE number = (current iteration number)


    I realize those are not ideal solutions, hopefully they are acceptable for now.

  • Avatar
    Ariel

    Hi Jay, thanks for your help with this.


    Supose that you have the following tree: Release-->Iteration-->Story


    I think you can use a project variable in MQL. The following query is working pretty good:


    {{ value query: SELECT COUNT(*) WHERE Type = Story AND Iteration = (Current Iteration)}}


    If I did something like this it works perfect too:


    {{ value query: SELECT COUNT(*) WHERE Type = Iteration AND Release= (Current Release)}}


    The problem is that the Iteration doesn´t have a Property called Iteration and I think that´s why the query is failing


    {{ value query: SELECT COUNT(*) WHERE Type = Iteration AND Iteration= (Current Iteration)}}


    What I am not sure, based on what you said is that something like this could work:


    {{ value query: SELECT COUNT(*) WHERE Type = Iteration AND number= (Current Iteration Number)}}

  • Avatar
    Jay Mitchell

    Yes, your last example should work Ariel.

Please sign in to leave a comment.