cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

--queryDefinition= string sample

jdcc
1-Visitor

--queryDefinition= string sample

Hi all,

I am new here and i need help on how to use createquery via CLI. Can you please provide a sample of string for --queryDefinition option in commandline.

This is what I have that don't work.

im.exe createquery --name=Test --queryDefinition=((field["Project title"] = "9497") and (field["State"] = "Open") and (field["Created By"] = "jc185178","mp185138","ms185250","rv185054"))

Is there something wrong with the queryDefinition string?

Thanks,

Jd

ACCEPTED SOLUTION

Accepted Solutions
matt_giltaji
12-Amethyst
(To:Maxim)

Hi jdcc.

You will also want to make sure that the quotes around the overall definition are not the same as the quotes around the field names in the definition, as this has caused problems for me on Windows 7 and Windows Vista.

--queryDefinition='((field["Project title"] = "9497") and (field["State"] = "Open") and (field["Created By"] = "jc185178","mp185138","ms185250","rv185054"))'

Also if you have any shortext or longtext fields, you should use contains rather than =, for example

(field["Summary"] contains "xyz") instead of (field["Summary"] = "xyz") otherwise the command will return with an error message.

Matt

View solution in original post

3 REPLIES 3
Maxim
1-Visitor
(To:jdcc)

Hi jdcc,

try it with quotes around your Defintion:

--queryDefinition="((field["Project title"] = "9497") and (field["State"] = "Open") and (field["Created By"] = "jc185178","mp185138","ms185250","rv185054"))"

Kind regards,

Maxim

matt_giltaji
12-Amethyst
(To:Maxim)

Hi jdcc.

You will also want to make sure that the quotes around the overall definition are not the same as the quotes around the field names in the definition, as this has caused problems for me on Windows 7 and Windows Vista.

--queryDefinition='((field["Project title"] = "9497") and (field["State"] = "Open") and (field["Created By"] = "jc185178","mp185138","ms185250","rv185054"))'

Also if you have any shortext or longtext fields, you should use contains rather than =, for example

(field["Summary"] contains "xyz") instead of (field["Summary"] = "xyz") otherwise the command will return with an error message.

Matt

thanks maxim and matt

Announcements


Top Tags