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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How to use sortDirection in Java API

sziel
5-Regular Member

How to use sortDirection in Java API

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

3 REPLIES 3
kjain2
14-Alexandrite
(To:sziel)

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

sziel
5-Regular Member
(To:kjain2)

Thanks Kapil, that makes sense 😅

I'll check that later.

kjain2
14-Alexandrite
(To:sziel)

Hi @sziel 

If that works please mark this as accepted solution.

Vielen Dank / Many Thanks,

Kapil Jain

Announcements


Top Tags