Service Desk Practitioners Forum
cancel

WebApi code problem

Highlighted
Tim Black
Super Contributor.

WebApi code problem

This is my first attempt with the sd webapi so you probably have to be patient with some rookie mistakes that I might have made.

The attached code is supposed to find a service with the name service ( variable inputed ). I've tried it and it allways returns "More than one service found" , no matter if I put XPTO or if I put a real one that does exist and that is unique. I've got a lot of code like this one ( get category, get name, etc ) and they all return more than one no matter what I input...

The part of the code is attached.

Thanks
8 REPLIES
Tim Black
Super Contributor.

Re: WebApi code problem

were is : wg_wh.addCriteriumOnName(service);

is : sv_wh.addCriteriumOnName(service);

Sorry for the error.
Vasily Kamenev
Acclaimed Contributor.

Re: WebApi code problem

Hi
Insert in code before closeConnection() for(int=0;i
Vassili
Tim Black
Super Contributor.

Re: WebApi code problem

Actually it wasn't anything related with that piece of code, the problem was way back in the code. Thanks anyway.

I also need to do a get of several fields on the Person, like Name, Email, address, organization it belongs to...

Does anyway have an example on how to make a multiple get based on a userfield ( PersonText1 in my case )

Thank you in advance.
Vasily Kamenev
Acclaimed Contributor.

Re: WebApi code problem

HI
Sorry can't understand you correctly. Are you like search person by CF1 and set in service search?

Vassili
Tim Black
Super Contributor.

Re: WebApi code problem

Sorry if it was confusing.

I need to have a class that recieves a file ( for example : public String getInfo(String usernr ) and returns details of the user which has that number ( the number is my my custom field PersonText1, that's why I mentioned that field ).

When I say return details of the user I mean return stuff like Name, Full Name, Address, email and other user fields.

Tim Black
Super Contributor.

Re: WebApi code problem

When I say a class that recieves a file I mean recieves a value.
Vasily Kamenev
Acclaimed Contributor.

Re: WebApi code problem

Hi
are you like that(in Attch)?

Vassili
Tim Black
Super Contributor.

Re: WebApi code problem

Thanks a lot vassili, that's close enought to what I need. Just some changes and I'll get it to do what I need.

Thank you