- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2021 02:14 PM
Hi All,
I have a small query .
I have one configuration item field for RITM and TASK both which is referencing to cmdb_ci table .For one catalog item i want to display one configuration item .
I tried run script in workflow with below
task.cmdb_ci="Automated Regulation";
Also i tried with Insert update BR with setting valuse of cmdb ci field to same value on RITM table .
But value is not being displayed .Please suggest me what am i missing here .Or suggest any other way to achieve this .
Thanks .
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2021 11:24 PM
Hi,
For SC Task you can use this
task.setDisplayValue("cmdb_ci","Automated Regulation");
For RITM Record you can use Run Script activity in your workflow
current.setDisplayValue("cmdb_ci","Automated Regulation");
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2021 02:29 PM
Hi, for a reference field you need to populate the sys_id of the reference record, not it's 'name'
if you do not have the sys_id you will need to use GlideRecord to look it up.
Assuming the name is unique, something like this should work.
var myCI = new GlideRecord('yourCITable');
if(myCi.get('fieldName', 'thenameOfTheCI')) { // use if conditon to ensure we only populate with a match
task.cmdb_ci = myCi.sys_id;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2021 01:19 PM
Hi Tony,
Thanks for your response .
It's working for task can you help me for RITM also .How can i set for RITM for same field.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2021 11:15 PM
For RITM current.configuration_item = "sys_id of CI";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2021 11:24 PM
Hi,
For SC Task you can use this
task.setDisplayValue("cmdb_ci","Automated Regulation");
For RITM Record you can use Run Script activity in your workflow
current.setDisplayValue("cmdb_ci","Automated Regulation");
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader