servicenow

Module for execution of ServiceNow CI (configuration items)

Added in version 2016.11.0.

depends:

servicenow_rest python module

configuration:

Configure this module by specifying the name of a configuration profile in the minion config, minion pillar, or master config. The module will use the ‘servicenow’ key by default, if defined.

For example:

servicenow:
  instance_name: ''
  username: ''
  password: ''
saltext.servicenow.modules.servicenow.__virtual__()[source]

Only load this module if servicenow is installed on this minion.

saltext.servicenow.modules.servicenow.set_change_request_state(change_id, state='approved')[source]

Set the approval state of a change request/record

Parameters:
  • change_id (str) – The ID of the change request, e.g. CHG123545

  • state (str) – The target state, e.g. approved

CLI Example:

salt myminion servicenow.set_change_request_state CHG000123 declined
salt myminion servicenow.set_change_request_state CHG000123 approved
saltext.servicenow.modules.servicenow.delete_record(table, sys_id)[source]

Delete an existing record

Parameters:
  • table (str) – The table name, e.g. sys_user

  • sys_id (str) – The unique ID of the record

CLI Example:

salt myminion servicenow.delete_record sys_computer 2134566
saltext.servicenow.modules.servicenow.non_structured_query(table, query=None, **kwargs)[source]

Run a non-structed (not a dict) query on a servicenow table.

Parameters:
  • table (str) – The table name, e.g. sys_user

  • query (str) – The query to run (or use keyword arguments to filter data)

CLI Example:

salt myminion servicenow.non_structured_query sys_computer 'role=web'
salt myminion servicenow.non_structured_query sys_computer role=web type=computer
saltext.servicenow.modules.servicenow.update_record_field(table, sys_id, field, value)[source]

Update the value of a record’s field in a servicenow table

Parameters:
  • table (str) – The table name, e.g. sys_user

  • sys_id (str) – The unique ID of the record

  • field (str) – The new value

  • value (str) – The new value

CLI Example:

salt myminion servicenow.update_record_field sys_user 2348234 first_name jimmy