The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Setting new values to Service call fields

Highlighted
Koijam Baleshwo
Regular Collector

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
Member

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
Regular Collector

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
//Add this to "OnDomLoad" event