How do you automatically add a work notes to an incident when it's first created?

Antonie
Kilo Contributor

Hi, I'm quite new to the snow dev platform and have a simple request that I can't seem to get it to work correctly: I need to create an automatic work notes (e.g. say “This is an auto-generated message") when an incident of category Network is created by user. How/where do I do it?

I've tried adding in the business rule but doesn't get it to work.

A related question: if I assign this Network incident to a group automatically upon submitting the ticket, can the work notes be created automatically based on the group that I have pre-assigned instead of checking the category?

Thank you.

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

Hi Antonie,

If you're new to the platform and coding in general, I'd go with a flow designer approach to meet your needs.

 

1. You'd use a trigger of created and then your condition of category is Network

find_real_file.png

2. Can then use a simple Update Incident Record action to add a work note

find_real_file.png

 

3. Not sure if I understand your additional question but if you're wanting to set the assignment group based on the fact the user set the category to network, you'd just add another field to the Update Incident Record action.

find_real_file.png

View solution in original post

9 REPLIES 9

Akshay H Mulky
Kilo Guru

Hi Antonie,

You can use onSubmit Client Script:

 

function onSubmit() {
	
	var groupSysId = '9040c7d42fd6181092ac235df699b602'; //sysId of Group
	var category = 'network';
	
    if ((g_form.getValue('category') == category) ||
        (g_form.getValue('assignment_group') == groupSysId)) {
        g_form.setValue('work_notes', "This is an auto-generated message");

    }

}

Hi Akshay, may I know where I can add this onSubmit() or onChange() methods in the portal?

Hi Antonie,

Right click on gray header ---> configure ---> client scripts

find_real_file.png  

Thanks Akshay, but the work notes is not shown onto the record when i check it again..

Because post save work notes will showup in the activities:

 

find_real_file.png