
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 12:09 AM
Hi all
I have got the following workflow activities in place:
- Run Script: Create Configuration Item in cmdb_ci_ip_phone and save sys_id of inserted record to the workflow's scratchpad
- Catalog Task: Update internal phone book. The task has got task.cmdb_ci set to the sys_id of the Configuration Item created in step 1.
I would like to update the cmdb_ci_ip_phone record after the Catalog Task has been created (sys_updated_on of cmdb_ci_ip_phone should be newer than sys_created_on of sc_task).
- How can I do so? The Catalog Task waits until it has been set to inactive.
- I did already try to update cmdb_ci_ip_phone in the advanced script part using GlideRecord, but cmdb_ci_ip_phone.sys_updated_on is not always newer than sc_task.sys_created_on.
- Can I somehow add an event, which triggers an update of the cmdb_ci_ip_phone?
Regards
-Luca.
PS: I do want to have the cmdb_ci_ip_phone.sys_updated_on newer than sc_task.sys_created_on, because we do sync our tables to an internal database. We have to apply a rule so that we can be sure that the sc_task is not pointing to an outdated version of cmdb_ci_ip_phone.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 12:22 AM
I've found a solution to solve my issue. With the script below the previsously created CI entry will have an sys_updated_on which is later than the sys_created_on of the Catalog Task:
var updateCI = task.cmdb_ci.getRefRecord();
updateCI.autoSysFields(false);
updateCI.sys_updated_on = gs.minutesAgo(-1);
updateCI.comments = current.number.toString();
updateCI.update();
I've pasted this code to the Advanced script section. The autoSysFields(false) will take care, that the sys_ fields does not get updated automatically.
Regards
-Luca.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 02:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 02:26 AM
So, in the "Run Script: Set status of record to Deployed", you are setting the status of cmdb_ci_ip_phone record which is created in "Run Script: Create Record".... and still it is not changing the sys_updated_on value in cmdb_ci_ip_phone record?
Is my understanding correct?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 12:16 AM
Hi Sumeet
No, this does work as expected. The sys_updated_on is set correctly there.
I do want the following timings:
0s: Create CI: cmdb_ci.sys_created_on = 0s, cmdb_ci.sys_updated_on = 0s
1s: Create Task: sc_task.sys_created_on = 1s, sc_task.sys_created_on = 1s, cmdb_ci.sys_updated_on = >1s
I've found a solution to do this.
Regards
-Luca.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 12:22 AM
I've found a solution to solve my issue. With the script below the previsously created CI entry will have an sys_updated_on which is later than the sys_created_on of the Catalog Task:
var updateCI = task.cmdb_ci.getRefRecord();
updateCI.autoSysFields(false);
updateCI.sys_updated_on = gs.minutesAgo(-1);
updateCI.comments = current.number.toString();
updateCI.update();
I've pasted this code to the Advanced script section. The autoSysFields(false) will take care, that the sys_ fields does not get updated automatically.
Regards
-Luca.