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: 

How to convert Service Call ID into OID

Highlighted
Ali Safwan
Super Collector

How to convert Service Call ID into OID

Hello Dear,

i am trying to View the Details of some specific service call.. I can use
ViewEditServiceCall.jsp? [OID]

but the issue is that i only have the service call id e.g. 153022

can you please guide me how to convert the ID {153022} into OID {281531293108941}

so that i could use the URL like

http://XYZ.com/ViewEditServiceCall.jsp?vSc=281531293108941

I would appriciate if you could send me some code of JSP
5 REPLIES
Sam decosta
Esteemed Contributor

Re: How to convert Service Call ID into OID

Hi Ali,

You can have Have one new JSP Page and there you find the OID of service call from databse by using sql query.

Assign the value of the OID to one variable

and then redirect the page to below URL.

respons.sendRedirect(â http://XYZ.com/ViewEditServiceCall.jsp?vSc=â +Variable);

Thanks,
Avinash
Ali Safwan
Super Collector

Re: How to convert Service Call ID into OID

Dear Shrivastava,
Thanks for your kind response....
Really thankful to you.

Yes you are right that we can easly find the OID from Database using the service call ID
But the I dont know how to connect or Call SQL from a jsp web page...

I tried few codes from Internet to connect to Oracle DB but failed

This is for the first time i am using jsp...
if you can kindly send me some code of connectvity with Oracle DB

Thanks A Lot
Sam decosta
Esteemed Contributor

Re: How to convert Service Call ID into OID

Hi Ali,

See attached file. This for connecting from JSP to SQL server.modify it as per your need.

I think it should work for Oracle also.

You need to create one ODBC for Oracle.while creating ODBC you need to select "Microsoft ODBC for Oracle" as data source name.



Thanks,
Avinash
Ali Safwan
Super Collector

Re: How to convert Service Call ID into OID

Dear Shrivastava,

Thanks a lot for the help but can you please tell me some API funtion which directly takes ID as input and provides OID as an output


Because following are the API already attached with the application code

<%@ page import="com.hp.itsm.ssp.beans.SdClientBean" %>
<%@ page import="com.hp.itsm.ssp.beans.SortCode" %>
<%@ page import="com.hp.itsm.ssp.beans.NoTemplateException" %>
<%@ page import="com.hp.itsm.api.interfaces.IServicecallHome" %>
<%@ page import="com.hp.itsm.api.interfaces.IServicecallEntitlement" %>
<%@ page import="com.hp.itsm.api.interfaces.IServicecall" %>
<%@ page import="com.hp.itsm.api.interfaces.IServicecallWhere" %>
<%@ page import="java.text.Collator" %>
<%@ page import="java.util.Iterator" %>


Regards

Ali Safwan
Sam decosta
Esteemed Contributor

Re: How to convert Service Call ID into OID

Hi Ali,

As mentioned in below discussion

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1073191

You can create a DB rule to capture OID of service call in some text field and use this field in your URL.

to acheive this you can create a VB/Java Script to capture OID based on ID of service call and execute this script through DB Rule while creation of service call.

Points are welcome :)
Thanks,
Avinash
//Add this to "OnDomLoad" event