- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2021 07:40 AM
Hello experts please I need your help, how can I create a mail script that can be added to the subject line of an email?
There are 2 fields in the incident form:
*Subcategory
*Missing CI
the subject line needs to change based on the user selection:
if the user clicks on CI Missing, the the subject field needs to have the subcategory field information:
Subject:High Priority Incident - INC0010616 - Antivirus
If the user selects a CI instead, then the subject line needs to have the CI name, not the subcategory field information:
Subject: High Priority Incident - INC0010616 - MacBook Air 13''
Thank you
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2021 07:48 AM
You can't add a mailscript to the subject, but you can call a mailscript in the body and set the subject.
Just write your logic to create the string you want to set, then in the mailscript call:
var str = 'your subject';
email.setSubject(str);
I hope this helps!
If this was helpful or correct, please be kind and remember to click appropriately!
Michael Jones - Proud member of the CloudPires team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2021 07:48 AM
You can't add a mailscript to the subject, but you can call a mailscript in the body and set the subject.
Just write your logic to create the string you want to set, then in the mailscript call:
var str = 'your subject';
email.setSubject(str);
I hope this helps!
If this was helpful or correct, please be kind and remember to click appropriately!
Michael Jones - Proud member of the CloudPires team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 01:55 AM
Hi Michael, how can I add current year to the subject. Example: Your subject + 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 04:00 AM
Something like this:
var str = 'your subject' + ' ' + new GlideDateTime().getYearLocalTime();
email.setSubject(str);
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 06:36 PM
Hi Michael,
Thanks for your response and expertise. I am very grateful for your help. Thank you, Michael!