Service Desk Practitioners Forum
cancel

Setting new values to Service call fields

Highlighted
Koijam Baleshwo
Respected Contributor.

Setting new values to Service call fields

Hi,
i have written a code to set new values in fields of service calls ticket in java. the value of "status" have been set from "new" to "progress". i had check that using out statement. but the changes is not reflected in the OVSD view, the status remains "new" even after setting to "progress" using setStatus() of the IServiceCall class. Refer the code snippet:

public static void assign(IServicecall serviceCall)
{

String statusStr = null;
IStatusServicecall status = serviceCall.getStatus();
if (status != null)
{
statusStr = status.getText();
}
//printing the default status, it print "new"
System.out.println("status1 :"+statusStr);
status.setText("progress");
//setting the ticket into "progress" status
serviceCall.setStatus(status);
IStatusServicecall st2 = serviceCall.getStatus();

String statusStr2 = st2.getText();
//printing the updated status, it prints "progress " here.
System.out.println("status 2:"+statusStr2);


}
the only issue is that after setting the status to "progress" the ticket is still in the "new" status. do i need to perform any action to save the status, or is there any API available for the purpose, i am a new to the web api, please assist "5 POINT EACH FOR THE ANSWER".


Thank you in advance.
Balesh
2 REPLIES
Ben Snell
Super Contributor.

Re: Setting new values to Service call fields


Hi

You are doing a serviceCall.save() in another part of your code?

Cheers
Ben
Koijam Baleshwo
Respected Contributor.

Re: Setting new values to Service call fields

Hi,

yeah, i even tried with that "serviceCall.save()" but it shows a runtime excpeption " there is no changes to be saved".
I even tried setting with "In Progress".i am facing the same issue.


Regards,
Balesh