created by field in sys_journal_field table populated from where?

Mohamed Taha
Tera Expert

I have BR works on incident table with when is before inserted or updated 
based on some condition I insert additional comment using this command 
current.comments="some text here";

and it appears correctly but it sets the created by to me" current user" instead of system 

how can i solve this or edit it to make the created_by field to system

6 REPLIES 6

Mark Manders
Mega Patron

What happens if you do it 'after'? I didn't try it (my pdi is sleeping), but on the before I am sure the business rule will set the created by as the user triggering it. If after does the same, a flow running as system will surely put 'system' in there.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

I've tried to change it to before but nothing change

swathisarang98
Giga Sage
Giga Sage

Hi @Mohamed Taha ,

 

Did you try adding one more line current.autoSysFields(false); in the br ?If not please do give it a try and let me know if this does not work for you.

 

Else you can try something as below,

 current.comments.setJournalEntry('some text here', 'System');

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

Do I need to change the BR to after instead of before or it will work with before ?