Skip to main content
Matrix42 Self-Service Help Center

Object Data Service: Update Object


Updates the Object of the specified Configuration Item by the Configuration Item name and object ID. The operation is designed for the complex update transactions, where the modified object attributes belong to different fragments (Data Definitions), or the object multi-fragments need to change (added, deleted, updated), or there is some business logic is triggered on Update transaction (see more Data Object CRUD operations Middleware).  For cases when just a few attributes from the same Data Definition are updating, it is recommended to use light-weight operation Update Fragment 

Better to use the Update Object operation in pair with the  “Get Object” method, which obtains the original Object with the right structure and the actual Timestamp (the marker of the current state).


In a highly concurrent environment where many users and 3-rd Party applications are simultaneously working on and modifying the same data could lead to data saving conflicts.

For instance, it could happen that an agent (user or another application) tries to change the data, which has been already modified between the moment the agent obtained the latest version of the data (object) and the moment the Update operation is triggered.  As a result, the Update operation just overwrites the recent changes. All of that could lead to data inconsistency and overall Product misbehavior. To prevent such side-effect the Update operation supports two different modes:

  • Track Concurrency:
  1. Specify TimeStamp: include the TimeStamp attribute to the Request Body with the value received via the Service operation Objects.Get. 
  2. Compare values: the System checks the TimeStamp value and rejects the Update transaction if the values in the Database and in the Update request differ.  In this case, the Service operation returns Error 500. For more details see the example below.
  • Ignore Concurrency
    For cases when tracking of concurrency is not important or there is no other agent which modifies the data, the Update operation can be executed without checking Concurrency. For that, just do not include the TimeStamp in the Request Body.

The Server throws the Concurrency exception in case the updated fragment has been updated between Objects.Get operation and Objects.Update.

Full Update (with Multi-Fragmetns)

For the single fragments, the operation updates only the attributes mentioned in the Request body (partial object update), and do not touch attributes which not part of the Request. But for multi-fragments the operation fulfills only full update, what means the request should include all present fragment with required modifications.  As far as operations with the Multi-Fragments usually not needed,  the default Update operation fully ignores the changes in the Multi-Fragments. The Multi-Fragments update functionality needs to be activated on demand, using the Query String parameter "?full=true". 
The Update operation in mode Full update the only multi-fragment Data Definitions which are mentioned in the Request. If the Request does not have even property which keeps the Multi-Fragments objects, in such case, this Multi-Fragments are not effected on the update.

Try to avoid using Update Full operation until the operation with multi-fragments is required. 

Use operation Objects.Get?full=true to obtain the whole original object from Server and use it for preparing Full Update operation.

Multiple Relations

The Virtual attributes/relations, like N:M or 1:N relations, are not affected by the Object Update operation. For executing changes in relations, use the dedicated methods:



PUT https://{server_domain}/m42Services/api/data/objects/{ciName}?full={full}

URL Attributes and Query Parameters

Element Description Type Required
ciName Technical name of the Configuration Item (e.g. for Incident is "SPSActivityTypeIncident") string Required


Signals to update the whole Object with all related multi-fragments data, otherwise, all multi-fragments changes are ignored. Default value: false boolean Optional


For a list of available HTTP request headers see Web Services: REST API integration.


JSON Object.  The object has the following format

         "Attribute4":"Name 1"
         "Attribute4":"Name 2"

"ID" required attribute with the Id of the updated object. 

Concurrency tracking: if you want to track concurrency also include the TimeStamp attribute to each mentioned Data Definition

Reset the attribute value: in case you want to reset the attribute value add this attribute to JSON object with the value null.


The server does not return any data.

Status codes and errors

The following table lists the returned HTTP status codes.

Code Description
500 Concurrency. The object you want to update has been updated by another process!



Example #1: Update Incident Impact and Urgency

The example demonstrates how the changing of the "Impact" or "Urgency" triggers the Business logic which recalculates the Incident Priority and other attributes. 

PUT https://{server_name}/m42Services/api/data/objects/SPSActivityTypeIncident/ HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json;charset=UTF-8

Example #2: Add New Journal record to Incident

Journal record is the multi-fragment (SPSActivityClassUnitOfWork) of the Incident Configuration Item.

The example in Javascript code  demonstrates data update which involves such steps:

  1. Retrieve the whole Incident object, with all related multi-fragments;
  2. Add new Jounal records;
var objectId = '7777780d-71a0-df11-708c-000c2968299e';

//receive the whole Incident object with multi-fragments
var xhr = new XMLHttpRequest();'GET', 'http://localhost/m42Services/api/data/objects/SPSActivityTypeIncident/' + categoryId + '?full=true', true);
xhr.setRequestHeader('Authorization', 'Bearer ' + token);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
   if (this.readyState == 4 && this.status == 200 && this.responseText!==nul) {
      //covert response string to Object 
      var incidentObject = JSON.parse(this.responseText);
      //prepare new request for Update
      var svchttp = new XMLHttpRequest();'PUT', 'http://localhost/m42Services/api/data/objects/SPSActivityTypeIncident?full=true', true);
      svchttp.setRequestHeader('Authorization', 'Bearer ' + token);
      svchttp.setRequestHeader('Content-Type', 'application/json');
      //add new record for Journal
         "OriginalSolutionHtml":"Journal Comment",
      //update Default Sender only


  • Was this article helpful?