Update Department operation

The Update Department operation updates the details of a department.

The following table describes the elements of the <items> XML element and the adapter request. If not specified, the valid value for an element should be assumed to be a string.

The default value for all elements is ignored.

Note

A combination of the <department-name> and <company> elements must be used as the key. Therefore, the combined resultant value of the <department-name> and <company> pair must be unique.

Elements for the <items> XML element and adapter request for the Update Department operation

Element

Definition

Required

<operation-name>

Specifies the name of the operation: update-department

Yes

<model>

Contains the other elements in the request

Yes

<keys>

Contains elements that uniquely identify a record

Yes

<instance>

Specifies a unique record

The children of the <instance> element describe the fields of the record.

The only two higher-level elements are <keys> and <instance>. All other elements are child elements of the <instance> element.

Yes

<department>

Specifies the department to be updated

Valid value: Any string in the "Company/Department Name" format

Yes

<department-name>

Specifies the name of the department

A combination of the <department-name> and <company> elements must be used as the key.

Valid value: Any unique string containing the <department-name> and <company> pair

No

<company>

Specifies the name of the company

Valid value: Any unique string containing the <department-name> and <company> pair

Notes:

  • The <company> element can be a child element of the <keys> and <instance> elements.
  • You can specify the <company> element in the <keys> element when the <department> element cannot uniquely locate the department to be updated.
  • You can specify the <company> element in the <instance> element to specify the new desired value for the <company> to be updated.

No

<department-i-d>

Specifies the ID of the department to be updated

Valid value: Any string

No

<department-s-l-a>

Specifies the ID for the Service Level Agreement (SLA) for the department

No

<parent-department>

Specifies the parent department

Valid value: Any string, or an existing department record from the application repository

No

<cost-manager>

Specifies the cost manager of the department

Valid value: Any string

No

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

Sample adapter request for the Update Department operation


 <hp-service-manager-request>
    <entity>configurationitem</entity>
    <entity-type>department</entity-type>
    <request>
      <operation-name>update-department</operation-name>
      <parameters>
        <update-department-request>
          <model>
            <keys>
              <department>
                <value>C-0001/DeptName22</value>
                <type>String</type>
              </department>
              <company>
                <value>C-0001</value>
                <type>String</type>
              </company>
            </keys>
            <instance>
              <department-name>
                <value>DeptNameNew</value>
                <type>String</type>
              </department-name>
              <company>
                <value>CompanyNameNew</value>
                <type>String</type>
              </company>
              <department-i-d>
                <value>department i d new</value>
                <type>String</type>
              </department-i-d>
            </instance>
          </model>
        </update-department-request>
      </parameters>
    </request>
  </hp-service-manager-request>


The following figure displays an adapter response for the Update Department operation.

Sample adapter response for the Update Department operation


<hp-service-manager-response>
  <metadata>
    <count>1</count>
  </metadata>
  <responses>
    <response>
      <metadata>
        <count>1</count>
      </metadata>
      <item>
        <metadata>
          <status>success</status>
        </metadata>
        <parameters>
          <model>
            <keys>
              <department>
                <value>CompanyNameNew/DeptNameNew</value>
                <type>String</type>
              </department>
              <company>
                <value>CompanyNameNew</value>
                <type>String</type>
              </company>
            </keys>
            <instance>
              <department>
                <value>CompanyNameNew/DeptNameNew</value>
                <type>String</type>
              </department>
              <department-i-d>
                <value>department i d new</value>
                <type>String</type>
              </department-i-d>
              <department-s-l-a>
                <value>169</value>
                <type>Decimal</type>
              </department-s-l-a>
              <company>
                <value>CompanyNameNew</value>
                <type>String</type>
              </company>
              <parent-department>
                <value>parent department</value>
                <type>String</type>
              </parent-department>
              <department-structure>
                <value>DeptNameNew</value>
                <type>String</type>
              </department-structure>
              <department-full-name>
                <value>CompanyNameNew/DeptNameNew</value>
                <type>String</type>
              </department-full-name>
              <department-name>
                <value>DeptNameNew</value>
                <type>String</type>
              </department-name>
              <cost-center>
                <value>cost center</value>
                <type>String</type>
              </cost-center>
              <uniquequery>dept="CompanyNameNew/DeptNameNew" and company="CompanyNameNew"</uniquequery>
              <recordid>CompanyNameNew/DeptNameNew - CompanyNameNew</recordid>
            </instance>
          </model>
          <messages>
            <element>
              <value>Department record updated.</value>
            </element>
          </messages>
          <status>SUCCESS</status>
          <message>Success</message>
          <schema-revision-date>2010.01.20 00:00:00</schema-revision-date>
          <schema-revision-level>5</schema-revision-level>
          <return-code>0</return-code>
        </parameters>
      </item>
    </response>
  </responses>
</hp-service-manager-response>
Was this page helpful? Yes No Submitting... Thank you

Comments