How can we call mail script through quick message??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2018 03:08 AM
Hi,
How can we call mail script through quick message??
We have created quick message for email and its working fine.
but for more customization need to call mail script.
Can you please suggest how i can call mail script though quick message?
Reference Code:
Below is my Quick message for email:
Please find below defect details.
- Priority: ${priority}
- State: ${state}
- Urgency: ${urgency}
- Short Description: ${short_description}
- Description: ${description}
- Print Screen: ${u_print_screens}
- Worklog : ${mail_script:detailed_worknotes}
Below is my mail script "detailed_worknotes" which needs to be called from quick message:
template.print(current.work_notes.getJournalEntry(-1));
Job of mail script is to extract whole "worknotes" for INC which needs to be printed on email.
Can somebody suggest on this.
Thanks in advance 🙂
Thanks and Regards,
Priyanka Kute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2018 06:30 PM
Hi Priyanka,
Quick messages do not support mail script execution, You can directly refer to ${variable_name} in it. And you might need to use notifications for the mail scripts to work.
In your example mail script, I see that are trying to fetch all the work notes. Mail Script used:
template.print(current.work_notes.getJournalEntry(-1));
There is a workaround for your situation if you only want to use the Email client and not the email notification and just want to fetch all the journal entries.
1) In the Quick Message Body add the following:
- Worklog : ${work_notes}
2) And set the property glide.email.journal.lines to -1
NOTE: Setting the above property to -1 will include ALL journal entries (Additional comments, Work notes, etc.) in ALL the email notifications wherever you use journal entries variables in the notification as glide.email.journal.lines is a global property.
Please let us know if the shared info was helpful by marking the response as Helpful.
Feel free to reach out if you have any additional questions.
Best Regards,
Mukul Gupta @ ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2018 11:07 PM
Thanks for your quick reply Mukul,
The above solution is helpful for me.
But is it possible , I can override global property?
Or is there any other way, I can get all the entries of worknotes in my Quick message?
Thanks and Regards,
Priyanka Kute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2018 11:18 PM
Hi Priyanka,
As Quick messages do not support mail script execution thus I am not sure if there could be any other way to get all the work notes in the Email client.
Global property is something which is always checked and if you have any mail script called in a notification, for example, something like:
template.print(current.work_notes.getJournalEntry(3));
It will fetch last 3 work notes in the above example no matter if glide.email.journal.lines property is set to -1
Please let us know if the shared info was helpful by marking the response as Helpful.
Feel free to reach out if you have any additional questions.
Best Regards,
Mukul Gupta @ ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2018 11:17 PM
The above solution is helpful for me.
But is it possible , I can override global property?
Or is there any other way, I can get all the entries of worknotes in my Quick message?
Thanks and Regards,
Priyanka Kute