- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 06:46 AM
I have created 2 Business rules for work notes copied from RITM to sc tasks and Sc tasks to RITM but all is working fine but whenever update the work notes in sc task then Updated in RITM and also affecting on the All attached tasks of RITM
BR:
Table: sc_req_item
When: After Update
condition: worknotes changes
(function executeRule(current, previous /*null when async*/)
{ var sys_id = current.getUniqueValue();
var scTaskGR = new GlideRecord('sc_task');
scTaskGR.addActiveQuery();
scTaskGR.addQuery('request_item', sys_id);
scTaskGR.query(); if(scTaskGR.hasNext()){
var curWN = current.work_notes.getJournalEntry(1);
while(scTaskGR.next())
{ if(scTaskGR.work_notes.getJournalEntry(1) == '' || curWN.indexOf(scTaskGR.work_notes.getJournalEntry(1)) <0)
{ scTaskGR.work_notes = curWN; scTaskGR.update();
} } }
})(current, previous);
BR:
Table: sc_task
When: After update
condition: worknotes changes
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 07:40 AM
Hi @siva44 ,
While adding the worknotes from RITM to SCTASK, try to add a string that notifies, from where the worknotes is being added.
Added worknotes on RITM: Test notes on RITM.
Add worknotes to SCTASK: Copying worknotes from RITMXXXXX: Test notes on RITM. (Here, Copying worknotes from RITMXXXXX: will work as an indication).
While copying the worknotes to RITM/SCTASK, check the indication string and stop it from adding.
Mark the response correct and helpful if the answer assisted your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 07:40 AM
Hi @siva44 ,
While adding the worknotes from RITM to SCTASK, try to add a string that notifies, from where the worknotes is being added.
Added worknotes on RITM: Test notes on RITM.
Add worknotes to SCTASK: Copying worknotes from RITMXXXXX: Test notes on RITM. (Here, Copying worknotes from RITMXXXXX: will work as an indication).
While copying the worknotes to RITM/SCTASK, check the indication string and stop it from adding.
Mark the response correct and helpful if the answer assisted your question.