<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed Materials - Property of IBM Corp.
- IBM UrbanCode Build
- IBM UrbanCode Deploy
- IBM UrbanCode Release
- IBM AnthillPro
- (c) Copyright IBM Corporation 2002, 2016. All Rights Reserved.
-
- U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by
- GSA ADP Schedule Contract with IBM Corp.
-->

<plugin
  xmlns="http://www.urbancode.com/PluginXMLSchema_v1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <!--  ===================================================================
        Metadata
        ===================================================================  -->
  <header>
    <identifier version="18" id="com.urbancode.air.plugin.ServiceNow" name="ServiceNow"/>
    <description>
      The ServiceNow plugin allows for the easy automation of CRUD operations on ServiceNow records.
    </description>
    <tag>ITSM Process/ServiceNow</tag>
  </header>

  <!--  ===================================================================
        Check Records
        ===================================================================  -->
  <step-type name="Check Records">
    <description>Check records against specified field values.</description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     default-value="${p:resource/serviceNow/serverUrl}"
                     label="Server URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="table" required="true">
        <property-ui type="textBox"
                     label="Table Name"
                     default-value="${p:serviceNow/tableName}"
                     description="The Name, what you see in the XML export, of the table to be updated.
                     Example: change_request"/>
      </property>
      <property name="id" required="true">
        <property-ui type="textAreaBox"
                     label="Record System IDs"
                     description="Newline seperated list of unique IDs of record to check. Represents the sys_id field."/>
      </property>
      <property name="fields" required="true">
        <property-ui type="textAreaBox"
                     label="Check Fields"
                     description="Newline seperated list of field value pairs.
                      You may use the Name, what you see in the XML export, of the field. The record(s) will be checked to ensure that the values of the inputed field match and that the fields exist.
                      For example: description=This is a high valued task"/>
      </property>
      <property name="username" required="true">
        <property-ui type="textBox"
                     default-value="${p:resource/serviceNow/userName}"
                     label="User Name"
                     description="The user name to be used to connect to the ServiceNow server."/>
      </property>
      <property name="password" required="true">
        <property-ui type="secureBox"
                     default-value="${p:resource/serviceNow/password}"
                     label="Password"
                     description="The password to be used to connect to the ServiceNow server."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/commons-lang.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="check_records.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Create Records
        ===================================================================  -->
  <step-type name="Create Records">
    <description>Creates records by table name and specified fields.</description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     label="Server URL"
                     default-value="${p:resource/serviceNow/serverUrl}"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="table" required="true">
        <property-ui type="textBox"
                     label="Table Name"
                     default-value="${p:serviceNow/tableName}"
                     description="The Name (not the Label) of the table to be updated. Example: change_request"/>
      </property>
      <property name="fields">
        <property-ui type="textAreaBox"
                     label="Row Fields"
                     description="The Fields to insert for this row. Each name-value pair should be on a separate line. A '=' separates the name and value. Example: name=value"/>
      </property>
      <property name="username" required="true">
        <property-ui type="textBox"
                     label="ServiceNow user name"
                     default-value="${p:resource/serviceNow/userName}"
                     description="Provide the user name to authenticate with ServiceNow."/>
      </property>
      <property name="password" required="true">
        <property-ui type="secureBox"
                     label="ServiceNow password"
                     default-value="${p:resource/serviceNow/password}"
                     description="Provide the password to authenticate with ServiceNow."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-lang.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="CreateTableRecords.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Delete Records
        ===================================================================  -->
  <step-type name="Delete Records DEPRECATED">
    <description>Deletes records by table name and record system IDs.</description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     label="Server URL"
                     default-value="${p:resource/serviceNow/serverUrl}"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="table" required="true">
        <property-ui type="textBox"
                     label="Table Name"
                     default-value="${p:serviceNow/tableName}"
                     description="The Name (not the Label) of the table to update. Example: change_request"/>
      </property>
      <property name="id" required="true">
        <property-ui type="textAreaBox"
                     label="Record System IDs"
                     description="Newline seperated list of unique IDs of record to delete. Represents the sys_id field."/>
      </property>
      <property name="username" required="true">
        <property-ui type="textBox"
                     label="ServiceNow User name"
                     default-value="${p:resource/serviceNow/userName}"
                     description="Provide the user name to authenticate with ServiceNow."/>
      </property>
      <property name="password" required="true">
        <property-ui type="secureBox"
                     label="ServiceNow Password"
                     default-value="${p:resource/serviceNow/password}"
                     description="Provide the password to authenticate with ServiceNow."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-lang.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="delete_row.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Run Encoded Query
        ===================================================================  -->
  <step-type name="Run Encoded Query">
    <description>Run an encoded query and receive a newline list of record system IDs to pass to subsequent steps.</description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     default-value="${p:resource/serviceNow/serverUrl}"
                     label="ServiceNow URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="table" required="true">
        <property-ui type="textBox"
                     label="Table Name"
                     default-value="${p:serviceNow/tableName}"
                     description="The Name, what you see in the XML export, of the table to be updated.
                     Example: change_request"/>
      </property>
      <property name="query" required="true">
        <property-ui type="textBox"
                     label="Encoded Query"
                     description="The query value of your encoded query. Use the copy query function in ServiceNow."/>
      </property>
      <property name="username" required="true">
        <property-ui type="textBox"
                     default-value="${p:resource/serviceNow/userName}"
                     label="User Name"
                     description="The user name to be used to connect to the ServiceNow server."/>
      </property>
      <property name="password" required="true">
        <property-ui type="secureBox"
                     default-value="${p:resource/serviceNow/password}"
                     label="Password"
                     description="The password to be used to connect to the ServiceNow server."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/commons-lang.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="run_encoded_query.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Update Records
        ===================================================================  -->
  <step-type name="Update Records">
    <description>Update records by specifying field values.</description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     default-value="${p:resource/serviceNow/serverUrl}"
                     label="Server URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="table" required="true">
        <property-ui type="textBox"
                     label="Table Name"
                     default-value="${p:serviceNow/tableName}"
                     description="The Name, what you see in the XML export, of the table to be updated.
                     Example: change_request"/>
      </property>
      <property name="id" required="true">
        <property-ui type="textAreaBox"
                     label="Record System IDs"
                     description="Newline seperated list of unique IDs of record to check. Represents the sys_id field."/>
      </property>
      <property name="fields" required="true">
        <property-ui type="textAreaBox"
                     label="Fields to Update"
                     description="Newline separated list of field value pairs.
                      You may use the Name, what you see in the XML export, of the field. Fields described here will be updated on each record to specified value. If the field does not exist the step will fail.
                      For example: description=This is a high valued task"/>
      </property>
      <property name="username" required="true">
        <property-ui type="textBox"
                     default-value="${p:resource/serviceNow/userName}"
                     label="User Name"
                     description="The user name to be used to connect to the ServiceNow server."/>
      </property>
      <property name="password" required="true">
        <property-ui type="secureBox"
                     default-value="${p:resource/serviceNow/password}"
                     label="Password"
                     description="The password to be used to connect to the ServiceNow server."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/commons-lang.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="update_records.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Check Approval Status
        ===================================================================  -->
  <step-type name="Check Approval status">
    <description>
      Deprecated. Please use the 'Run Encoded Query' and 'Check Records' steps instead.
    </description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     default-value="${property:resource/serviceNow/serverUrl}"
                     label="Server URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="serviceNowReleaseName" required="true">
        <property-ui type="textBox"
                     label="ServiceNow release name"
                     default-value="${p?:resource/serviceNowReleaseName}"
                     description="Provide the release name of the ServiceNow instance. For example: fuji"/>
      </property>
      <property name="changeRequestId" required="true">
        <property-ui type="textBox"
                     label="Change Request Number"
                     description="The value of the Number field for the relevant Change Request."/>
      </property>
      <property name="status" required="true">
        <property-ui type="textBox"
                     label="Approval"
                     description="The Change Request's Approval field value you are checking against (approved, rejected, requested, not yet requested)."/>
      </property>
      <property name="username" required="false">
        <property-ui type="textBox"
                     default-value="${property:resource/servicenow/username}"
                     label="User Name"
                     description="The user name to be used to connect to the ServiceNow server."/>
      </property>
      <property name="password" required="false">
        <property-ui type="secureBox"
                     default-value="${property:resource/servicenow/password}"
                     label="Password"
                     description="The password to be used to connect to the ServiceNow server."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/commons-lang.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="check_approval.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Check Change Request Status
        ===================================================================  -->
  <step-type name="Check Change Request status">
    <description>
      Deprecated. Please use the 'Run Encoded Query' and 'Check Records' steps instead.
    </description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     default-value="${property:resource/serviceNow/serverUrl}"
                     label="Server URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="serviceNowReleaseName" required="true">
        <property-ui type="textBox"
                     label="ServiceNow release name"
                     default-value="${p?:resource/serviceNowReleaseName}"
                     description="Provide the release name of the ServiceNow instance. For example: fuji"/>
      </property>
      <property name="changeRequestId" required="true">
        <property-ui type="textBox"
                     label="Change Request Number"
                     description="The value of the Number field for the relevant Change Request."/>
      </property>
      <property name="status" required="true">
        <property-ui type="textBox"
                     label="Status integer"
                     description="The status you want to ensure the Change Request has. This is an integer key corresponding to the state value-key pair used by ServiceNow. By default -5 is Pending, 1 is Open, 2 is Work in Progress, 3 is Closed Complete, 4 is Closed Incomplete, and 7 is Closed Skipped. You can find your particular key-value pairs by opening a task in ServiceNow, clicking on 'Additional actions' button by the title, 'Configure'->'Form Design', and then clicking the 'edit this field' settings button that appears when selecting the state field."/>
      </property>
      <property name="username" required="false">
        <property-ui type="textBox"
                     default-value="${property:resource/servicenow/username}"
                     label="User Name"
                     description="The user name to be used to connect to the ServiceNow server."/>
      </property>
      <property name="password" required="false">
        <property-ui type="secureBox"
                     default-value="${property:resource/servicenow/password}"
                     label="Password"
                     description="The password to be used to connect to the ServiceNow server."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-lang.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="check_status.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Check Change Request Fields
        ===================================================================  -->
    <step-type name="Check Change Request Fields">
        <description>
            Checks Change Request Fields.
        </description>
        <properties>
            <property name="serverUrl" required="true">
                <property-ui type="textBox"
                             default-value="${property:resource/serviceNow/serverUrl}"
                             label="Server URL"
                             description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
            </property>
            <property name="changeRequestId" required="true">
                <property-ui type="textBox"
                             label="Change Request Number"
                             description="The value of the Number field for the relevant Change Request."/>
            </property>
            <property name="fields" required="true">
                <property-ui type="textAreaBox"
                             label="Check Fields"
                             description="Newline seperated list of field value pairs.
                      You may use the Name, what you see in the XML export, of the field. The record(s) will be checked to ensure that the values of the inputed field match and that the fields exist.
                      For example: description=This is a high valued task"/>
            </property>
            <property name="username" required="false">
                <property-ui type="textBox"
                             default-value="${property:resource/servicenow/username}"
                             label="User Name"
                             description="The user name to be used to connect to the ServiceNow server."/>
            </property>
            <property name="password" required="false">
                <property-ui type="secureBox"
                             default-value="${property:resource/servicenow/password}"
                             label="Password"
                             description="The password to be used to connect to the ServiceNow server."/>
            </property>
            <property name="proxyHost">
                <property-ui type="textBox"
                             label="HTTP Proxy Host"
                             description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
            </property>
            <property name="proxyPort">
                <property-ui type="textBox"
                             label="HTTP Proxy Port"
                             description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
            </property>
            <property name="proxyUser">
                <property-ui type="textBox"
                             label="HTTP Proxy User name"
                             description="Provide the user name to authenticate with HTTP proxy."/>
            </property>
            <property name="proxyPass">
                <property-ui type="secureBox"
                             label="HTTP Proxy Password"
                             description="Provide the password to authenticate with HTTP proxy."/>
            </property>
        </properties>
        <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
        <command program="${GROOVY_HOME}/bin/groovy">
            <arg value="-cp"/>
            <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-lang.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
            <arg file="check_change_fields.groovy"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

  <!--  ===================================================================
        Check Change Request's Child Tasks Statuses
        ===================================================================  -->
  <step-type name="Check Change Request's Child Tasks statuses">
    <description>Deprecated. Please use the 'Run Encoded Query' and 'Check Records' steps instead.</description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     default-value="${property:resource/serviceNow/serverUrl}"
                     label="Server URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="serviceNowReleaseName" required="true">
        <property-ui type="textBox"
                     label="ServiceNow release name"
                     default-value="${p?:resource/serviceNowReleaseName}"
                     description="Provide the release name of the ServiceNow instance. For example: fuji"/>
      </property>
      <property name="changeRequestId" required="true">
        <property-ui type="textBox"
                     label="Change Request Number"
                     description="The value of the Number field for the relevant Change Request."/>
      </property>
      <property name="status" required="true">
        <property-ui type="textBox"
                     label="Status integer"
                     description="The status you want to ensure that the childern Change Tasks of the Change Request request have. This is an integer key corresponding to the state value-key pair used by ServiceNow. By default -5 is Pending, 1 is Open, 2 is Work in Progress, 3 is Closed Complete, 4 is Closed Incomplete, and 7 is Closed Skipped. You can find your particular key-value pairs by opening a task in ServiceNow, clicking on 'Additional actions' button by the title, 'Configure'->'Form Design', and then clicking the 'edit this field' settings button that appears when selecting the state field."/>
      </property>
      <property name="username" required="false">
        <property-ui type="textBox"
                     default-value="${property:resource/servicenow/username}"
                     label="User Name"
                     description="The user name to be used to connect to the ServiceNow server."/>
      </property>
      <property name="password" required="false">
        <property-ui type="secureBox"
                     default-value="${property:resource/servicenow/password}"
                     label="Password"
                     description="The password to be used to connect to the ServiceNow server."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-lang.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="check_tasks_status.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Delete Multiple Table Records
        ===================================================================  -->
  <step-type name="_DEPRECATED Delete Multiple Table Records">
    <description>Deprecated. Please use the 'Run Encoded Query' and 'Delete Records' step instead.</description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     label="Server URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="serviceNowReleaseName" required="true">
        <property-ui type="textBox"
                     label="ServiceNow release name"
                     default-value="${p?:resource/serviceNowReleaseName}"
                     description="Provide the release name of the ServiceNow instance. For example: fuji"/>
      </property>
      <property name="table" required="true">
        <property-ui type="textBox"
                     label="Table Name"
                     default-value="${p:serviceNow/tableName}"
                     description="The name of the table to update. Example: change_request"/>
      </property>
      <property name="condition" required="true">
        <property-ui type="textBox"
                     label="CMDB Row Condition"
                     description="The Encoded Query a row must match for deletion. See http://wiki.servicenow.com/index.php?title=Embedded:Encoded_Query_Strings for examples"
                     placeholder="bc477d510f310200c6c63e4ce1050eb6^GOTOcolumn_label>=test^internal_type="/>
      </property>
      <property name="username" required="true">
        <property-ui type="textBox"
                     label="ServiceNow User name"
                     description="Provide the user name to authenticate with ServiceNow."/>
      </property>
      <property name="password" required="true">
        <property-ui type="secureBox"
                     label="ServiceNow Password"
                     description="Provide the password to authenticate with ServiceNow."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-lang.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="delete_multiple_rows.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ===================================================================
        Set Change Request Status
        ===================================================================  -->
  <step-type name="Set Change Request status">
    <description>
      Deprecated. Please use the 'Run Encoded Query' and 'Update Records' steps instead.
    </description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     default-value="${property:resource/serviceNow/serverUrl}"
                     label="Server URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="serviceNowReleaseName" required="true">
        <property-ui type="textBox"
                     label="ServiceNow release name"
                     default-value="${p?:resource/serviceNowReleaseName}"
                     description="Provide the release name of the ServiceNow instance. For example: fuji"/>
      </property>
      <property name="changeRequestId" required="true">
        <property-ui type="textBox"
                     label="Change Request Number"
                     description="The value of the Number field for the relevant Change Request."/>
      </property>
      <property name="status" required="true">
        <property-ui type="textBox"
                     label="Status integer"
                     description="The status you want to set on the Change Request. This is an integer key corresponding to the state value-key pair used by ServiceNow. By default -5 is Pending, 1 is Open, 2 is Work in Progress, 3 is Closed Complete, 4 is Closed Incomplete, and 7 is Closed Skipped. You can find your particular key-value pairs by opening a task in ServiceNow, clicking on 'Additional actions' button by the title, 'Configure'->'Form Design', and then clicking the 'edit this field' settings button that appears when selecting the state field."/>
      </property>
      <property name="username" required="false">
        <property-ui type="textBox"
                     default-value="${property:resource/servicenow/username}"
                     label="User Name"
                     description="The user name to be used to connect to the ServiceNow server."/>
      </property>
      <property name="password" required="false">
        <property-ui type="secureBox"
                     default-value="${property:resource/servicenow/password}"
                     label="Password"
                     description="The password to be used to connect to the ServiceNow server."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-lang.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="update_status.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

  <!--  ==================================================================
        Update Tasks Statuses
        ==================================================================  -->
  <step-type name="Update Tasks statuses">
    <description>
      Deprecated. Please use the 'Run Encoded Query' and 'Update Records' steps instead.
    </description>
    <properties>
      <property name="serverUrl" required="true">
        <property-ui type="textBox"
                     default-value="${property:resource/serviceNow/serverUrl}"
                     label="Server URL"
                     description="The URL of your ServiceNow portal. Example: https://myaccount.service-now.com"/>
      </property>
      <property name="serviceNowReleaseName" required="true">
        <property-ui type="textBox"
                     label="ServiceNow release name"
                     default-value="{p?:resource/serviceNowReleaseName}"
                     description="Provide the release name of the ServiceNow instance. For example: fuji"/>
      </property>
      <property name="tasksId" required="true">
        <property-ui type="textBox"
                     label="Task ID List"
                     description="A comma-separated list of the sys_id Field value of the Change Tasks to be updated. sys_id can be found under the 'Addtional properties' button adjecent to the left of the Change Task title."/>
      </property>
      <property name="status" required="true">
        <property-ui type="textBox"
                     label="Status integer"
                     description="The status you want apply to the listed Tasks. This is an integer key corresponding to the state value-key pair used by ServiceNow. By default -5 is Pending, 1 is Open, 2 is Work in Progress, 3 is Closed Complete, 4 is Closed Incomplete, and 7 is Closed Skipped. You can find your particular key-value pairs by opening a task in ServiceNow, clicking on 'Additional actions' button by the title, 'Configure'->'Form Design', and then clicking the 'edit this field' settings button that appears when selecting the state field."/>
      </property>
      <property name="username" required="false">
        <property-ui type="textBox"
                     default-value="${property:resource/servicenow/username}"
                     label="User Name"
                     description="The user name to be used to connect to the ServiceNow server."/>
      </property>
      <property name="password" required="false">
        <property-ui type="secureBox"
                     default-value="${property:resource/servicenow/password}"
                     label="Password"
                     description="The password to be used to connect to the ServiceNow server."/>
      </property>
      <property name="proxyHost">
        <property-ui type="textBox"
                     label="HTTP Proxy Host"
                     description="Provide the hostname of the HTTP proxy to use to connect to ServiceNow. Eg proxy.domain.com"/>
      </property>
      <property name="proxyPort">
        <property-ui type="textBox"
                     label="HTTP Proxy Port"
                     description="Provide the port number of the HTTP proxy to use to connect to ServiceNow."/>
      </property>
      <property name="proxyUser">
        <property-ui type="textBox"
                     label="HTTP Proxy User name"
                     description="Provide the user name to authenticate with HTTP proxy."/>
      </property>
      <property name="proxyPass">
        <property-ui type="secureBox"
                     label="HTTP Proxy Password"
                     description="Provide the password to authenticate with HTTP proxy."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/log4j.jar:lib/CommonsUtil.jar:lib/httpclient.jar:lib/httpcore.jar:lib/groovy-all-1.8.8-json-backport.jar:lib/commons-lang3.jar:lib/commons-lang.jar:lib/commons-beanutils.jar:lib/commons-collections.jar:lib/commons-codec.jar:lib/HttpComponents-Util.jar:lib/securedata.jar:lib/jettison-1.1.jar"/>
      <arg file="update_tasks_status.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

</plugin>
