Skip to main content
1-Visitor
November 17, 2021
Question

How to use sortDirection in Java API

  • November 17, 2021
  • 1 reply
  • 1719 views

Hi,

I'm using the Java API_4_16.

I'd like to add the sortDirection as option:

 

 

...
command.addOption(new Option("sortField","Planned End Date"));
command.addOption(new Option("sortDirection","Ascending"));
...

 

 

when executing the command it throws this exception:

 

 

com.mks.api.response.InvalidCommandOptionException: im: MKS124819: Invalid option: "sortDirection"

 

 

So how to specifiy the sort direction 🤔

 

Regards,

Simon

1 reply

14-Alexandrite
November 18, 2021

Hi @sziel ,

 

If i am not wrong you are running "im issues" command and you want to get result in specific order based on a field. sortDirection is not a option in im issues command.

 

Please refer the help page to check which all options are available in specific command. https://<ServerName>:<ServerPort>/integrity122_hc/en/index.html#page/IntegrityHelp%2Fim_issues.html 

 

You should use like this:-

 

For Ascending:-

 

command.addOption(new Option("sortField","Planned End Date"));
command.addOption(new Option("sortAscending"));

 

For Descending:-

 

command.addOption(new Option("sortField","Planned End Date"));
command.addOption(new Option("nosortAscending"));

 

Does this help?

 

Vielen Dank / Many Thanks,

Kapil Jain

sziel1-VisitorAuthor
1-Visitor
November 24, 2021

Thanks Kapil, that makes sense 😅

I'll check that later.

14-Alexandrite
December 1, 2021

Hi @sziel 

If that works please mark this as accepted solution.

Vielen Dank / Many Thanks,

Kapil Jain