Task Management


This section describes the adapter request and response for Task Management operations.

Find Task operation

The Find Task operation retrieves task details from the Service Now application.  

The following table describes the elements for this request. 

Adapter request elements for the Find Task operation

Element

Definition

Required

<operation-name>

Contains the name of the operation: find-task

Yes

<proxy-settings>

Specifies the parent tag that contains the proxy server information

To enable <proxy-settings>, do these steps:

  1. On the server or the peer on which the ServiceNow adapter is installed and running, open the command line.
  2. Go to the <AO_HOME>\tomcat\bin directory and run the following command:

    tomcat9w.exe //ES//<PEER_SERVICE_NAME>
    Example
    tomcat9w.exe //ES//BAO_CDP
  3. On the service dialog box, click the Java tab, and in Java options, add the following property: 

    -Djdk.http.auth.tunneling.disabledSchemes=””
  4. Restart the service. 

No

<host>

Specifies the IP or host name of the proxy server

Conditional; required only if <proxy-settings> is provided

<port>

Specifies the port on which the proxy server listens for requests

Conditional; required only if <proxy-settings> is provided

<user-name>

Specifies the user name for the proxy server authentication

No

<password>

Specifies the password that corresponds to the proxy server<user-name>

You can encrypt the password by specifying the encryption-type attribute.

For example: <password encryption-type = "Base64">cGFzc3dvcmQ=</password> 

Valid values for the encryption-type attribute: Base64, Plain (Default)

No

<connection-parameters>

Contains the <user-name> and <password> elements

The <connection-parameters> element is required if you want to override the default values for username and password provided in the adapter configuration. 

No

<user-name>

Specifies the user name required to run the request

No; required if <connection-parameters> is specified

<password>

Specifies the password that corresponds the <user-name>

You can encrypt the password by specifying the encryption-type attribute.

No; required if <connection-parameters> is specified

<arguments>

Specifies a list of arguments required for the operation

Yes

<All>

When <All> is specified, all the task records are retrieved.

No

The following figure displays a sample adapter request for the Find Task operation.

Sample <items> XML for the Find Task operation

<items>
<item>
<change-request>CHG9000131</change-request>
</item>
</items>

The following figure describes the sample adapter request XML for the Find Task operation.

Sample adapter request for the Find Task operation in 20.19.02.002 or later

<service-now-request>
   <operation-name>find-incident</operation-name>
<proxy-settings>
     <host>10.129.94.127</host>
     <port>8080</port>
     <user-name>tso</user-name>
     <password>****MASKED****</password>
   </proxy-settings>
   <arguments>
     <connection-parameters>
       <user-name>admin</user-name>
       <password>****MASKED****</password>
     </connection-parameters>
    <change-task-type>Planning</change-task-type>
 <change-request>CHG0000032</change-request>
 <created-from>Workflow</created-from>  
 <description>Post implementation testing</description>
  <escalation>Normal</escalation>
<knowledge>0</knowledge>
 <made-sla>1</made-sla>
<number>CTASK0010128</number>
<parent>CHG0000032</parent>
<priority>3 - Moderate</priority>
 <reassignment-count>0</reassignment-count>
 <short-description>Post implementation testing</short-description>
  <state>4</state>
<sys-class-name>Change Task</sys-class-name>
</arguments>
 </service-now-request>


Sample adapter request for the Find Task operation in 20.19.02.001 or earlier

<service-now-request>
   <operation-name>find-task</operation-name>
   <arguments>
     <change-request>CHG9000131</change-request>
   </arguments>
</service-now-request>

The following figure displays the adapter response irrespective of the adapter version.

Adapter response for the Find Task operation

<service-now-response>
 <metadata>
   <response-count>1</response-count>
   <status>success</status>
 </metadata>
 <responses>
   <response>
     <metadata>
       <count>2</count>
     </metadata>
     <item>
       <metadata>
         <status>success</status>
       </metadata>
       <parameters>
         <active>1</active>
         <approval>Not Yet Requested</approval>
         <change-request>CHG9000131</change-request>
         <contact-type>Phone</contact-type>
         <description>again</description>
         <escalation>Normal</escalation>
         <impact>3 - Low</impact>
         <knowledge>0</knowledge>
         <made-sla>1</made-sla>
         <number>CTASK0010002</number>
         <opened-at>2015-02-03 05:11:16</opened-at>
         <opened-by>System Administrator</opened-by>
         <order>0</order>
         <parent>CHG9000131</parent>
         <priority>4 - Low</priority>
         <reassignment-count>0</reassignment-count>
         <state>Open</state>
         <sys-class-name>Change Task</sys-class-name>
         <sys-created-by>admin</sys-created-by>
         <sys-created-on>2015-02-03 05:11:21</sys-created-on>
         <sys-domain>global</sys-domain>
         <sys-id>427e767809823100064b1c18d231c23a</sys-id>
         <sys-mod-count>0</sys-mod-count>
         <sys-updated-by>admin</sys-updated-by>
         <sys-updated-on>2015-02-03 05:11:21</sys-updated-on>
         <upon-approval>Proceed to Next Task</upon-approval>
         <upon-reject>Cancel all future Tasks</upon-reject>
         <urgency>3 - Low</urgency>
       </parameters>
     </item>
     <item>
       <metadata>
         <status>success</status>
       </metadata>
       <parameters>
         <active>1</active>
         <approval>Not Yet Requested</approval>
         <change-request>CHG9000131</change-request>
         <contact-type>Phone</contact-type>
         <escalation>Normal</escalation>
         <impact>3 - Low</impact>
         <knowledge>0</knowledge>
         <made-sla>1</made-sla>
         <number>CTASK0010001</number>
         <opened-at>2015-02-03 05:04:56</opened-at>
         <opened-by>System Administrator</opened-by>
         <order>0</order>
         <parent>CHG9000131</parent>
         <priority>4 - Low</priority>
         <reassignment-count>0</reassignment-count>
         <state>Open</state>
         <sys-class-name>Change Task</sys-class-name>
         <sys-created-by>admin</sys-created-by>
         <sys-created-on>2015-02-03 05:05:01</sys-created-on>
         <sys-domain>global</sys-domain>
         <sys-id>550d727809823100064b1c18d231c285</sys-id>
         <sys-mod-count>0</sys-mod-count>
         <sys-updated-by>admin</sys-updated-by>
         <sys-updated-on>2015-02-03 05:05:01</sys-updated-on>
         <upon-approval>Proceed to Next Task</upon-approval>
         <upon-reject>Cancel all future Tasks</upon-reject>
         <urgency>3 - Low</urgency>
       </parameters>
     </item>
   </response>
 </responses>
</service-now-response>

Update Task operation

The Update Task operation updates the specified details for a task. To update a task, you must first query the change number to which the task is allocated and then update the task.

The following table describes the elements for this request. 

Adapter request elements for the Update Task operation

Element

Definition

Required

<operation-name>

Contains the name of the operation: find-task

Yes

<proxy-settings>

Specifies the parent tag that contains the proxy server information.

To enable <proxy-settings>, do these steps:

  1. On the server or the peer on which the ServiceNow adapter is installed and running, open the command line.
  2. Go to the <AO_HOME>\tomcat\bin directory and run the following command:

    tomcat9w.exe //ES//<PEER_SERVICE_NAME>
    Example
    tomcat9w.exe //ES//BAO_CDP
  3. On the service dialog box, click the Java tab, and in Java options, add the following property: 

    -Djdk.http.auth.tunneling.disabledSchemes=””
  4. Restart the service. 

No

<host>

Specifies the IP or host name of the proxy server

Conditional; required only if <proxy-settings> is provided

<port>

Specifies the port on which the proxy server listens for requests

Conditional; required only if <proxy-settings> is provided

<user-name>

Specifies the user name for the proxy server authentication

No

<password>

Specifies the password that corresponds to the proxy server<user-name>

You can encrypt the password by specifying the encryption-type attribute.

For example: <password encryption-type = "Base64">cGFzc3dvcmQ=</password> 

Valid values for the encryption-type attribute: Base64, Plain (Default)

No

<connection-parameters>

Contains the <user-name> and <password> elements

The <connection-parameters> element is required if you want to override the default values for username and password provided in the adapter configuration. 

No

<user-name>

Specifies the user name required to run the request

No; required if <connection-parameters> is specified

<password>

Specifies the password that corresponds the <user-name>

You can encrypt the password by specifying the encryption-type attribute.

No; required if <connection-parameters> is specified

<arguments>

Specifies a list of arguments required for the operation

Yes

<query>

Specifies the query based on which the tasks will be updated 

If multiple matching tasks are found, all of them are updated.

No

<all>

Specifies the query based on which the tasks will be updated 

If multiple matching tasks are found, all of them are updated.

No

<update>

The elements nested within the <update> tag contain values for fields to be updated. If you do not specify <update> no change field is updated.

No

The following figure displays a sample adapter request for the Update Task operation.

Sample <items> XML for the Update Task operation 

<items>
 <item>
<query>
       <change-request>CHG0030024</change-request>
</query>
<update>
    <state>Open</state>
        <priority>2 - High</priority>
</update>
</item>
</items>

The following figure describes the sample adapter request XML for the Update Task operation.

Sample adapter request for the Update Task operation in 20.19.02.002 or later

<service-now-request>
   <operation-name>find-incident</operation-name>
<proxy-settings>
     <host>10.129.94.127</host>
     <port>8080</port>
     <user-name>tso</user-name>
     <password>****MASKED****</password>
   </proxy-settings>
   <arguments>
     <connection-parameters>
       <user-name>admin</user-name>
       <password>****MASKED****</password>
     </connection-parameters>
 <query>
 <change-task-type>Planning</change-task-type>
 <change-request>CHG0000032</change-request>
 <created-from>Workflow</created-from>  
 <description>Post implementation testing</description>
  <escalation>Normal</escalation>
<knowledge>0</knowledge>
 <made-sla>1</made-sla>
<number>CTASK0010128</number>
<parent>CHG0000032</parent>
<priority>3 - Moderate</priority>
 <reassignment-count>0</reassignment-count>
 <short-description>Post implementation testing</short-description>
  <state>4</state>
<sys-class-name>Change Task</sys-class-name>
</query>
      <update>
       <description>Please initiate the Implementation process.</description>
       <impact>3 - Low</impact>
       <knowledge>0</knowledge>
       <made-sla>1</made-sla>
        <number>CTASK0010001</number>
       <parent>CHG0030006</parent>
       <priority>2 - High</priority>
      <short-description>Implementation Task</short-description>
       <state>3</state>
     </update>
  </arguments>
 </service-now-request>

Sample adapter request for the Update Task operation in 20.19.02.001 or earlier

<service-now-request>
   <operation-name>update-task</operation-name>
   <arguments>
     <query>
       <change-request>CHG0030024</change-request>
     </query>
     <update>
       <state>Open</state>
       <priority>2 - High</priority>
     </update>
   </arguments>
 </service-now-request>


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

TrueSight Orchestration Content 24.3