Use UI Extensions to Make CI Fields Required

UI ExtensionUI extensions are now able to make the following standard CI fields mandatory when the CI’s status is set to a specific option (e.g. ‘In Production’ or ‘Standby for Continuity’):

  • System ID
  • Service
  • Site
  • Location
  • Remarks
  • Attachments (at least one)
  • Nr. of processors
  • Nr. of cores
  • Nr. of licenses
  • Service instances (at least one)
  • Users (at least one)
  • Configuration items (at least one)
  • Contracts (at least one)
  • Supplier
  • Serial number
  • Financial owner
  • PO number
  • Asset ID
  • Depreciation method
  • Start date
  • Warranty expiry date

Below is an example of JavaScript code that can be added to a UI extension to make all these fields required when a user sets the status of a CI to either ‘In Production’ or ‘Standby for Continuity’. This JavaScript attaches an event handler to the Status field to get the current value of the CI’s Status field.

ITRP.field('status').on('change', function() {
  var required = ITRP.field('status').val() === 'in_production' || ITRP.field('status').val() === 'standby_for_continuity';

Once this JavaScript code example has been added to a UI extension, it can be linked to one or more products to ensure that all these fields of all CIs that are linked to those products become required when their status is set to ‘In Production’ or ‘Standby for Continuity’.

Product with UI extension that makes CI fields required

When one of the product’s CIs is set to one of these status values, it can no longer be updated in 4me’s user interface unless all those standard fields have a value.

CI with required standard fields

Because the UI extensions work in the user interface of 4me, the JavaScript is not applied when CI updates are made using the REST API, the Import API, or the Mass Update functionality.