Business Rule to Auto update worknotes when assigned to a particular group

Mounika66
Giga Contributor

We have a requirement that in an Incident, if we assign the assignment group to Infosec group, the worknotes should get auto updated as 'Task is currently assigned to InfoSec team'.

Can any of you help me with this? I am still new to scripting and having a tough time with getting it to work. Thanks!

1 ACCEPTED SOLUTION

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

use the following script in a Before Business Rule with condition Assignment Group changes to 'Infosec':

current.work_notes = 'Task is currently assigned to InfoSec team';

If I have answered your question, please mark my response as correct and/or helpful so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

View solution in original post

4 REPLIES 4

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

use the following script in a Before Business Rule with condition Assignment Group changes to 'Infosec':

current.work_notes = 'Task is currently assigned to InfoSec team';

If I have answered your question, please mark my response as correct and/or helpful so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

Hey !

How to do it for the record which is present in related list , could you help me on that?
Change form is the table and implementation ID Logs is the related list record on change form.
I want to add comments on the implementation ID Logs worknotes , when state change to close on 'change form'.

scott barnard1
Kilo Sage

Hi you can try:

 

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

// Add your code here
current.work_notes = gs.getMessage('Task is currently assigned to InfoSec team');

})(current, previous);

 

And set the condition in the when to run tab as assignment group changes to InfoSec

 

Using a messgae helps if you are going to translate it later

Swapnil Meshram
Mega Guru

Hi Mounika,

 

1. Use Before business rule and tick on advanced option

2. When to run

Assignment group is info sec

3. Advanced

tick on  insert and update option

current.work_notes = "Task is currently assigned to InfoSec team ";

 

 Please find the attached screenshot for your reference.