Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi,
I am wondering how the Java API command for this CLI command would look like:
im issues --fields="ID,Summary" --sortField="Planned Release End Date" --queryDefinition=((field[Type]="Release")and(field[State]="Scheduled,In Progress")and(field[Project]="/some_project"))
I am stuck with the fields and the query definition option
What I have so far:
Command command = new Command(); command.setApp(Command.IM); command.setCommandName("issues"); command.addOption(new Option("sortField","Planned Release End Date"));
Or is there any way to run the CLI command via the Java API directly without having im.exe and IntegrityClient.exe called?
Regards,
Simon
Solved! Go to Solution.
Hello,
I'm running a --querydefinition in Java like that, e.g.:
List<Option> cmdOptions = new ArrayList<Option>();
cmdOptions.add(new Option("querydefinition", "((field[Project] = \"" + projectName
+ "\") and (field[Type] = RQ1_Input,RQ2_Requirement,RQ3_Design) and (item.content) and (not (field[KBRQ_Qualification Method] is unspecified)))"));
cmdOptions.add(new Option("fields", "ID,KBRQ_Qualification Method"));
Hint if you want to figure out the querydefintion: add a custom action to cmd.exe to your Client, define the quick query the way you want, open CMD via custom action and have a look at MKSSI_query environment variable. Hope that helps to get your java running.
Hello,
I'm running a --querydefinition in Java like that, e.g.:
List<Option> cmdOptions = new ArrayList<Option>();
cmdOptions.add(new Option("querydefinition", "((field[Project] = \"" + projectName
+ "\") and (field[Type] = RQ1_Input,RQ2_Requirement,RQ3_Design) and (item.content) and (not (field[KBRQ_Qualification Method] is unspecified)))"));
cmdOptions.add(new Option("fields", "ID,KBRQ_Qualification Method"));
Hint if you want to figure out the querydefintion: add a custom action to cmd.exe to your Client, define the quick query the way you want, open CMD via custom action and have a look at MKSSI_query environment variable. Hope that helps to get your java running.
ETA: or what uminet said. I should have refreshed before posting 😉
You would add the fields and queryDefinition options the same way as the sortField:
cmd.addOption(new Option("queryDefinition", "((field[Type]=Release)and(field[State]=Scheduled,In Progress)and(field[Project]=/some_project))")); cmd.addOption(new Option("fields", "ID,Summary"));
Thanks for the reply.
In fact there was a typo in my command
Your example helped to figure it out.