Skip to main content
1-Visitor
December 17, 2019
Solved

Relationship in querydefinition not possible

  • December 17, 2019
  • 1 reply
  • 2646 views

Hi,

I'm trying to create a query with a relationship. But it fails and have no idea why.

The command with error message:

im createquery --name=newQ --queryDefinition=((relationship["ID"] backwards forwards using ["Release"] = 3310308) and (field["Type"] = "Sprint"))
You may not supply operands (a selection) to: createquery

I have the same query defined in the GUI:

im viewquery SpecificSprint
...
Query Definition: ((relationship["ID"] backwards forwards using ["Release"] = 3310308) and (field["Type"] = "Sprint"))
Sorted By: ID (Descending)
Fields: ID,Type,Summary,State,Team,Sprint Scrum Master,Estimated Velocity,Sprint End Date,Sprint Start Date,Project
-----------------------

 And that one is working on the command line:

im issues --query=SpecificSprint
3310312 Sprint Scheduled [XB1061A][R1024.0_V10] XB1061A Integration Sprint 0

So how can I specify that query on the command line 🤔

Best answer by pmaechtlen

You must encase the Querydefinition in quotes, otherwise the commandline will not understand that this is a single argument and break it at every space.
Try:
im createquery --name=newQ --queryDefinition='((relationship["ID"] backwards forwards using ["Release"] = 3310308) and (field["Type"] = "Sprint"))'

1 reply

18-Opal
December 17, 2019

You must encase the Querydefinition in quotes, otherwise the commandline will not understand that this is a single argument and break it at every space.
Try:
im createquery --name=newQ --queryDefinition='((relationship["ID"] backwards forwards using ["Release"] = 3310308) and (field["Type"] = "Sprint"))'

sziel1-VisitorAuthor
1-Visitor
December 17, 2019

Thanks! For some reason I could not see the issue 😅