# Creating a Manage CMDB Task

<figure><img src="https://content.gitbook.com/content/hlW9jKl7dcDggHAPhNU9/blobs/DYkKYcWqiByEUUDBnqLC/CMDB.jpg" alt=""><figcaption></figcaption></figure>

These tasks can automatically:

* Create CMDB items (People, Configuration Items, Services, Service Actions, and Service Bundles)
* Update one or more fields on CMDB items that are linked to the current request.
* Delete CMDB items
* Create, update or delete links between CMDB items or CMDB items and stakeholders
* Transfer quantities of Software Product and Inventory items

Updates to CMDB items are added through transactions.

## Creating a Manage CMDB Task

1. Search for the **Request Details** window, if it is not already on screen.
2. Select the **Update Dependencies** explorer option on the **Request Details** window, or the  button from the toolbar. The **Task Dependencies** window appears with icons for task entity types displayed below the toolbar.
3. Double-click the  icon on the dependency diagram to display the **Manage CMDB Task Details** window.
4. Complete the common task fields.
5. At **Transaction Type**, select the type of transaction you would like to add.

* Select **Create Item** to set up a transaction to create a new CMDB item or person.
* Select **Update Item** to set up a transaction to update the details of a CMDB item or person.
* Select **Delete Item** to set up a transaction to delete a CMDB item or person and/or update the details of the CMDB item or person.
* Select **Create Link** to set up a transaction to link CMDB items, or CMDB items and stakeholders.
* Select **Update Link** to set up a transaction to edit the link details of an existing link between CMDB items, or CMDB items and stakeholders.
* Select **Delete Link** to set up a transaction to delete the link between CMDB items, or CMDB items and stakeholders.
* Select **Asset Management** **Transaction** to set up a transaction to automate a licensed asset management transaction.

6\.  Click **Add** and complete the transaction details.

{% hint style="warning" %}
If the allocation or reservation does not meet specified usage criteria during runtime, the transaction fails and the error is written into the execution history for the Manage CMDB task.
{% endhint %}

7\.  Depending on the type of transaction, map the fields to be updated by the transaction in the transaction details.

8\.  Save the transaction details.

## Viewing added transactions

The transactions appear in the browse table within the **Transactions** view.

Each transaction added to a Manage CMDB task appears in the transactions browse table. The following columns appear:

<table><thead><tr><th width="191">Name</th><th>the name specified for the transaction when adding it</th></tr></thead><tbody><tr><td>Type</td><td>the type of transaction (such as Create Item, or Update Item)</td></tr><tr><td>Status</td><td>whether the transaction has already run (Completed) or not yet run (Pending)</td></tr><tr><td>Result</td><td>the outcome of the transaction after it has run - Not Run, Succeeded, or Failed</td></tr><tr><td>Rerun on failure</td><td>the condition for re-running the transaction if it fail, as specified in the transaction details</td></tr><tr><td>Fail if no items affected</td><td>the condition for failing the task, as specified in the transaction details</td></tr><tr><td>Fail on mapping error</td><td>the condition for failing the task, as specified in the transaction details</td></tr></tbody></table>

You can view and update transactions added to a Manage CMDB task from a request within the **Manage CMDB Transactions** tab if the option is selected in the Tasks tab of your workflow management security role.

1. To change the order in which the transactions will be run, use the **Move Up** or **Move Down** buttons.
2. To view or edit the transaction details, select a transaction and click **Open**.
3. To delete a transaction, select a transaction and click **Delete**.

## Setting the transaction priority

Transactions are shown in the order of priority in the table under the **Transactions** view. The first (topmost) transaction will be executed, and then the second, and so on. You can change the order of the transactions by selecting a transaction and clicking the **Move Up** or **Move Down** buttons.

## Processing transactions on failure

If the **Process All Transactions** option is selected, the task will continue to run the next transaction if a transaction fails. Clear this option if you want the task to fail immediately and stop processing the rest of the transactions on the first transaction failure.

## Viewing the transaction history

A record of each transaction run for the Manage CMDB task appears in a table within the **Execution History** view. This view includes the date the transaction ran, whether it succeeded or not (**Result** column), and a message detailing the outcome of the transaction.

The **Execution History** view at the task level shows both failed and successful transactions, while the same named view on the **Transaction Details** only shows failed transactions.
