how to add incident number in subject of mail, when email gets triggered from email client.

Alexa alexa
Tera Contributor

Incident number in subject should be readonly for user.

Even if user make changes, if not only then also only incident number should be sent to recipient of the mail.

 

 

 

Thanks in advance.....

1 ACCEPTED SOLUTION

Sure I'll help, but still, I must point out that I think it would be better to teach your users. 🙂

find_real_file.png

Script as follows

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

	// checks if the subject contains "INC" and if not, try to add the INC-number from matching record
	if (current.getValue('subject').indexOf('INC') == -1) {
		var incGR = new GlideRecord('incident');
		if (incGR.get(current.getValue('instance'))) {
			var incNumber = incGR.getValue('number');
			current.setValue('subject', current.getValue('subject') + ' ' + incNumber);
		}		
	}
})(current, previous);

View solution in original post

5 REPLIES 5

suvro
Mega Sage
Mega Sage

You cannot make incident number read only in subject. You have to communicate the users not to remove the incident number from the subject  in the email body itself.

 

add ${number} in the subject to add incident number

Harish KM
Kilo Patron
Kilo Patron

Hi you can add ${number}  in the email client subject

Regards
Harish

OlaN
Giga Sage
Giga Sage

Hi,

You are talking about the email client, right?

This is a OOB UI page(?), which gets loaded with some parameters from the currently opened task record.
It should not be changed.

Instead you can write a business rule, that makes sure that the subject line always contains the record number. But that would be a quite complex solution for a very small gain.
Might be easier to teach your users to not alter the subject line, or to remember to include the record number.

Alexa alexa
Tera Contributor

Hii,

Can you help me with business rule???