Need to Map "Opened by " field in RITM to "Requested by" field in SC Task - Fix script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 08:44 AM
The "Opened by" field in the RITM and the "Requested by" field ( Custom field )in SC Task should be same. What is the solution ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 08:55 AM
What are you talking about? Updating record that are already in? If so then all records? Even the closed ones?
OR
You want to ensure that records that get created have same?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 09:04 AM
Hi @Anurag Tripathi , I need it for the closed ones as well. Any suggestions ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 09:00 AM - edited ‎06-20-2024 09:01 AM
HI @Sairam3697 ,
For mapping the data you need to use after update BR on sc_task table
OR
You can set the opened by field on REQ and then for showing on RITM form dot walk to REQ and show that priority field
BR after update on sc_task
Condition: openedby changes && current.request_item.cat_item.name == 'Your Catalog Item Name'
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
// update RITM
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.request_item);
ritm.openedby= current.openedby;
ritm.update();
})(current, previous);
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 09:02 AM
Hi @Sairam3697 ,
You can make the 'Requested by' to be auto populated who ever is raising the form and make the field as read only so that they cannot change it. The opened by field will also have the same userID as of 'Requested by' in this scenario.
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.