Additional Comments - Auto populate "Dear {Customer}, Best regards {Commented by}

Aparkoe
Tera Contributor

Hi Guys,

So the ServiceDesk have asked for additional comments to automatically add some text.
It Should be like the following:
"Dear {Customer},"
Comments added by ServiceDesk user
"Best regards {Commented By}"

The same would go for Resolution notes.

I don't know which way would be the best way to add this, but either pre populate the field with this information or add it when a "post" is added.

Best regards
Alexander

1 ACCEPTED SOLUTION

Hello Alexander,

Now I'm getting it.
This can be achieved with, for example, a ui action with a code similar to this:

function writeComment(){
	var message = "Dear " + g_form.getDisplayValue("caller_id") + ", <insert comments here>\n\n\n" + " Best regards, " + g_user.getUserName();
	g_form.setValue("comments", message);
	g_form.getControl("comments").focus();
}

Your ui action should look similar to this:

find_real_file.png


 

Don't forget to check the checkbox "Client" and to populate the "onclick" with the same function name as the one declared in the script.

Please, if this answer is relevant for you, please mark it as correct and helpful.

Thanks,

Filipe

View solution in original post

4 REPLIES 4

Filipe Cruz
Kilo Sage
Kilo Sage

Hello Aparkoe,

In which conditions do you want to do this? 
If the service desk is posting a comment to the user, the user should already receive a notification and that comment should be in the activity stream.

Why is it currently needed to have this additional comment being in place?
Can you elaborate on the requirement?

Thanks!

Aparkoe
Tera Contributor

Hi Felipe,

If a customer reports he wishes a new piece of software.
A Request with a request item is created. The Request Item is then commented on by the servicedesk worker. This all works. And the user are notified.
When he writes the additional comment, where he request extra information. 

But instead of the servicedesk user writing:
"Dear ***,

We need more information about ****.

Best regards
*****"

Then have the system auto-insert the polight things such as "Dear name" and "regards name". So they only have to write "We need more information about ****." 

Hope it makes better sense?

Regards
Alexander

Hello Alexander,

Now I'm getting it.
This can be achieved with, for example, a ui action with a code similar to this:

function writeComment(){
	var message = "Dear " + g_form.getDisplayValue("caller_id") + ", <insert comments here>\n\n\n" + " Best regards, " + g_user.getUserName();
	g_form.setValue("comments", message);
	g_form.getControl("comments").focus();
}

Your ui action should look similar to this:

find_real_file.png


 

Don't forget to check the checkbox "Client" and to populate the "onclick" with the same function name as the one declared in the script.

Please, if this answer is relevant for you, please mark it as correct and helpful.

Thanks,

Filipe

Hey Filipe! This is great and I have it mostly working. But somehow, despite using your script with "

g_form.getDisplayValue("caller_id")" it keeps giving me Incident Number instead of caller ID. Any idea what I'm doing wrong?