Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2022 02:51 AM
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.....
Solved! Go to Solution.
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 08:02 AM
Sure I'll help, but still, I must point out that I think it would be better to teach your users. 🙂
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);
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 08:02 AM
Sure I'll help, but still, I must point out that I think it would be better to teach your users. 🙂
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);