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

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

Thanks Kieran, this solved my needs! 🙂

Willem
Giga Sage
Giga Sage

If you want the Work note to be specific for that group, you have to save it somewhere. Either create a new field on the Group or hard code it in the business rule.

If you create a new field you can do the following with a business rule:

Before insert business rule.

You can have a check if the Assignment group is filled in like so:

find_real_file.png

Or have a default Worknote to fall back on.

(u_work_note can be replaced by your new field on the group)

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

	current.work_notes = current.assignment_group.u_work_note || "This is an auto-generated message";

})(current, previous);

mr18
Tera Guru
Tera Guru

Hi Antonie,

You can update the work notes in both ways

1. If category is Network

find_real_file.png

 

find_real_file.png

 

2. If assignment group is anything you choose

find_real_file.png

find_real_file.png