Service Now is a SAS service to support IT Service
Management for Helpdesk and workflows. This post will help you create a Service
Now incident using OSB using Email. I am using JDEV Studio Edition Version
12.2.1.1.0 for the post.
1.
Step1: Create a Business Service in OSB. Set
Transport as ‘email’
a.
Service Type: Any XML
b.
Provide your email to the Endpoint URI (this will
be overwritten later)
c.
Once saved, Provide SMTP server to the Email
Transport Configuration.
2.
Create a WSDL from the below schema-
<xsd:sequence>
<element
name="to" type="string" minOccurs="1"/>
<element
name="subject" type="string" minOccurs="1"/>
<element
name="from" type="string" minOccurs="1"/>
<element
name="body" type="string" minOccurs="1"/>
<element
name="type" type="string" minOccurs="1"/>
<element
name="cc" type="string" minOccurs="0"
nillable="true"/>
<element
name="name" type="string" minOccurs="0"
nillable="true"/>
<element
name="content" type="base64Binary"
minOccurs="0" nillable="true"/>
</xsd:sequence>
|
3.
Create a Proxy using the created WSDL. In the
route node call the Business Service created in Step 1. Update the transport
headers.
4.
Insert into the attachment, if an attachment is
needed to be passed -
<con:attachment
xmlns:con="http://www.bea.com/wli/sb/context">
<con:Content-Type>{$body/sen:sendEmailRequest//*[local-name()='type']/text()}</con:Content-Type>
<con:Content-Transfer-Encoding>base64</con:Content-Transfer-Encoding>
<con:body>{$decodedContent}</con:body>
</con:attachment>
|
5.
Finally changes with respect to service now.
Verify with Service Now team the email format and the parameters that needs to
be sent to have a Service Now ticket created. You can use the below concat to format
the request going to Business Service and this will create ticket using the Email
API of Service Now.
//constructing the email. needs to be in this order
concat('^',
$ticket.group ,
fn:codepoints-to-string(10)
,
'^', $ticket.userId ,
fn:codepoints-to-string(10),
'^', $ticket.impact ,
fn:codepoints-to-string(10),
'^', $ticket.affectedci ,
fn:codepoints-to-string(10),
'^', $ticket.area ,
fn:codepoints-to-string(10),
'^', $ticket.subarea ,
fn:codepoints-to-string(10),
'^', $ticket.urgency ,
fn:codepoints-to-string(10),
'^', $ticket.operatorId ,
fn:codepoints-to-string(10),
'^', 'incident' ,
fn:codepoints-to-string(10),
'^' , $ticket.nonci,
'^', + $ticket.title ,
fn:codepoints-to-string(10), '^',
$ticket.description ,
fn:codepoints-to-string(10) )
|
No comments:
Post a Comment