CA Service Management

CA SDM::. Webservice how to update ticket status 

Feb 23, 2018 07:27 AM

Do you need update ticket status, this article describes how to do it. there is some ways where you can update here it's written using "updateObject" and "changeStatus".

 

"updateObject" It's a powerfull method where you can update many things and i've been writing so many ways how do use it.

 

"changeStatus" You can update ticket status and also say who updated.

 

Enjoy, i hope this article can be usefull for you.

 

int sid;
            try
            {
                localhost.USD_WebService ws = new localhost.USD_WebService();
                sid = 0;
                sid = ws.login("servicedesk", "MyPassword");
            }
            catch { }

CA SDM::. Webservice login C# 

 

Update status using updateObject Method

int sid;
string[] attrVals = new string[2] {"status","CL"};
string[] attributes = new string[2] { "status", "summary" };
string objecthandle;
try
{
      localhost.USD_WebService ws = new localhost.USD_WebService();
      sid = 0;
      sid = ws.login("servicedesk", "password");
      objecthandle = "cr:" + Request.QueryString["id"]; //"cr:400001"
      ws.updateObject(sid, objecthandle, attrVals, attributes);
}
catch { }

 

 

Update status using changeStatus method

 

bool fnUpdateStaus(string id, string contact, string status, string comments)
{
// crs:400001 = Custom status
bool blnReturn = false;
int sid;
string[] attrVals = new string[2] { "status", status };
string[] attributes = new string[2] { "status", "summary" };
string objecthandle, objecthandleCnt = "";
try
{
ServiceReference1.USD_WebServiceSoapClient ws = new ServiceReference1.USD_WebServiceSoapClient();
string user = ConfigurationManager.AppSettings["user"].ToString();
string password = ConfigurationManager.AppSettings["password"].ToString();
sid = 0;
sid = ws.login(user, password);
objecthandle = "cr:" + id; //"cr:400001"
if (!String.IsNullOrEmpty(contact))
{ objecthandleCnt = "cnt:" + contact; }
ws.changeStatus(sid, objecthandleCnt, objecthandle, comments, status);
ws.logout(sid);
blnReturn = true;
}
catch(Exception e)
{
blnReturn = false;
}
return blnReturn;
}

 

 

know_more.png

link_C#.zip 

CA SDM::. webservice updateObject usando C# 

CA SDM::. Webservice Updateobject C# 

CA SDM::. webservice updateObject usando C# 

CA SDM Trabalhando com WebService 

 Outros conteúdos utilizando updateObject 

 

 

Summary CA Process Automation 

Summary CA Service Management Community 

Service Desk Manager 15 days Implementation 

CABI:: Summary - BOXI for CA SDM 

Summary CA SDM Scoreboard 

 

Was useful, please leave your feedback!

Statistics
0 Favorited
12 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.