Skip to content

Parsing and docs error for command: <%QUERYBUILDER%> #120

Description

@MarketHubb

According to the docs, the second argument for the <%QUERYBUILDER%> command is for the output format, which is not always the case.

Overview of issue

If the second argument is one of the predefined output formats (i.e., {text} or {uid}), the command will return the first selection (i.e., column) of the Query in that format.

However, if you pass the name of any other selection as the second argument - or the first selection if it's been renamed - the command will return the {text} of that selection.

Secondary issue

When purposefully passing a selection - and not an output format - as the second argument, the command does not parse the <%GET%> command.

Returns the uid of the first selection, regardless of it's name

<%QUERYBUILDER:queryId,{uid}%>

Returns undefined even when columnName is set to a selection found on the query

<%QUERYBUILDER:queryId,{<%GET:columnName%>}%>

Returns the text of the "Client" selection, regardless of it's position

<%QUERYBUILDER:queryId,{Client}%>

Proposed solution

Update the command to take 4 arguments:

  1. Block ref or alias
  2. Format of output
  3. Selection (default to Text)
  4. Number of results

Ensure the arguments are parsed before the command is run so <%GET%> can be used for any of the arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions