SCTask

yoli1
Tera Contributor

Hello team when adding a close comment to SCTask it show as created by Sytem rather than user creating the comment

yoli1_0-1695400547461.png

7 REPLIES 7

Peter Bodelier
Giga Sage

Hi @yoli1,

 

How are you adding the comment when close notes are filled?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

@Peter Bodelier Hi this is my BS :

 

(function executeRule(current, previous /*null when async*/ ) {

    var item = new GlideRecord('sc_req_item');
    item.get(current.request_item);
    item.close_notes = current.close_notes; //set close_notes to requested Item
    
    item.update();

})(current, previous);

 

i also get this error :

yoli1_0-1695405397651.png

the weird thing is when i'am trying to do the exact BS on another instance it works fine

 

Hi @yoli1,

 

This is only setting the close note. There is something else setting a comment as well.

 

The error is not related to this as far as I can see.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

@Peter Bodelier i have also this BS that sets comments 

(function executeRule(current, previous /*null when async*/) {

var item = new GlideRecord('sc_req_item');
item.get(current.request_item);
item.comments = current.comments.getJournalEntry(1); //Get last journal entry
item.update();

})(current, previous);

but the comment i added was a close note thats why i provided the bs related to close notes