additional comments on task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 05:57 AM
Hi,
How can I automatically copy additional comments from the support task to the associated request item when the supporter (assigned to) adds an additional comment?
Thank.Shir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 06:56 AM
Hello @Shir Sharvit
When: after insert and update
Conditions: Assigned to Supporter
Script:
var gr= new GlideRecord("sc_task");
gr.get(current.getValue("request_item"));
gr.<field name on request item>=current.comments.getJournalEntry(1);
gr.update();
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 07:22 AM
Hi @Shir Sharvit ,
You can create after update Business Rule n try this script.
(function executeRule(current, previous /*null when async*/) {
// Check if comments field has been updated
if (current.comments.changes()) {
// Get the associated Request Item
var requestItem = new GlideRecord('sc_req_item');
if (requestItem.get(current.request_item)) {
// Copy additional comments from Support Task to Request Item
requestItem.comments = current.comments.getJournalEntry(-1); // Copy the last comment
requestItem.update();
}
}
})(current,
previous);
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 07:29 AM
@Shir Sharvit You can create async business rule as its going to be related record update.
(function executeRule(current, previous /*null when async*/ ) {
var grReqItem = new GlideRecord('sc_req_item');
if (grReqItem.get(current.request_item)) {
grReqItem.comments = current.comments.getJournalEntry(1);
grReqItem.update();
}
})(current, previous);
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2023 10:29 PM
@Shir Sharvit If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!