Mahesh23
Mega Sage

Description:

You all might have come across the requirement where you need to update or delete bulk records based on some conditions and you might have made use of Fix Script or Background Script. But are you aware of the possibility to achieve the same without scripting ?? Yes you guessed it right, it is possible through System Data Management available Tokyo release onwards. 

At present System Data Management supports following jobs

  • Update Job
    Delete specific number of records from a table without using scripts by creating and executing delete jobs.
  • Delete Job
    Update specific number of records simultaneously without using scripts by creating and executing a batch update job.

Procedure to create Update Jobs:
Use Case : Update all active Incidents category to "Inquiry / Help" where Assignment group "Service Desk".

  1. Navigate to System Data Management > Update Jobs.

  2. Create a new Update Job and Fill the form according your use case.

    Fields
    Description
    TableSelect the Table that contains the records you want to update.
    Run business rules and enginesSetting Run business rules and engines to True enables and False disables the running of Business Rule. is same as using setWorkFlow(true/false) in Script.
    PreviewSelect Preview to view the number of records that match the conditions & clicking on the link with the number will open all matching records.
    Fields & valuesIn the Fields & values lists, select the field that you want to update and a new value.
    ConditionLimit the number of records in the update job by adding a condition or conditions that records must meet.
    • Select a field, operator, and field value.
      For example, [Category] [is] [Software].
    • (Optional) Use the OR and AND operators to add conditions.
    • (Optional) Select New Criteria to add another set of conditions.
    Auto updating system fieldsSetting Auto updating system fields to True will update audit fields (such as sys_updated_by sys_updated_by) and setting to False will suppress updating the fields.
    Auto updating system fields is same as using AutoSys Fields(true/false) in Script.
     

    Note: Limiting the number of records that are added to the update job can help prevent the table from being locked when the job is executed.

    find_real_file.png

  3. Select Continue to save the record.
  4. As soon as the job is saved the form provides options to schedule the job or Execute Now.
    Run at: Select the time to schedule the Update Job or you can run the Update Job during non-business hours to minimize the potential performance impact on your users.
    Execute Now: Clicking Execute Now will execute the job immediately.

  5. Click on Execute Now to execute the Update Job.

    find_real_file.png

  6. You can even rollback a completed Update Job to revert the updates to the records to do so click on Check execution results or Navigate to System Data Management > Update Jobs & open already executed job & under Related Links click on Rollback.

    find_real_file.png

    find_real_file.png

    Update Job Results:
    Before Update Job Execution

    find_real_file.png

    After Update Job Execution

    find_real_file.png

Procedure to create Delete Jobs:
Use Case : Delete all Incidents where Short Description contains Test keyword.

  1. Navigate to System Data Management > Delete Jobs.

  2. Create a new Delete Job and Fill the form according your use case.

    find_real_file.png

  3. Select Continue to save the record.
  4. As soon as the job is saved similar to Update Job the form provides options to schedule the job or Execute Now along with Preview Cascade.
    Run at: Select the time to schedule the Update Job or you can run the Update Job during non-business hours to minimize the potential performance impact on your users.
    Preview Cascade: Clicking on Preview Cascade will displays the number cascade deletions by the table. [ If a record in the parent table is deleted, then the corresponding records in the child table will automatically be deleted ]
    Execute Now: Clicking Execute Now will execute the job immediately.

    For example deleting all Incidents where Short Description contains Test keyword will also deletes the associated Task SLA records.
     
    find_real_file.png

  5. Click on Execute Now to execute the Delete Job.
  6. Similar to Update Job you can even rollback a completed Delete Job to revert the deleted records to do so click on Check execution results or Navigate to System Data Management > Delete Jobs & open already executed job & under Related Links click on Rollback.

    Delete Job Results:

    Before Delete Job Execution

    find_real_file.png

    After Delete Job Execution

    find_real_file.png


Happy Learning !!!

Comments
Darlene York
Tera Contributor

Hello, I think this is an awesome feature, if I can get it to work.   I am wanting to close a bunch (thousands) of tasks in our test environment.   

 

Im doing the following.

Table sc_task

Conditions

Assignment group is IT-User Access

Active is True

created on 08/02/2022

 

Fields

 

Summary - closed

Description - closed

Work notes - dy closing tasks

State - Closed Complete

Assignment group - IT-User Access

Assigned to - user name

 

Its running without errors, and the log says its updating, but the task are not closing.

 

Any help would be greatly appreciated.

Mahesh23
Mega Sage

Hello,

Try unchecking the Run business rules and engines checkbox and see.

Kannan Nair
Tera Contributor

Great Article. 

 

Please let me know whether if there is any way to automatically schedule it like a scheduled job?

Mahesh23
Mega Sage
Yajna Yadla
Tera Contributor

What is the use of checkboxes?

 

- Run business rules and engines 

- Auto updating system fields

 

Before the execute the job, If both are active what happened?

Before the execute the job, If both are false what happened?

nagasandeeb
Tera Contributor

I was updated assigned is from empty to platform user , I want to revert all the changes I was done in the incidents is it possible?

premnathk
Tera Contributor

I hope that update/delete jobs are good with Admin access. Do we have similar solution for other non admin users when they have edit access on particular tables such as cmdb ci, alm_asset, alm_hardware tables? Really appreciate your suggestions! Thanks.

Version history
Last update:
‎09-15-2022 08:50 AM
Updated by: