- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 10:33 AM
hey everyone,
going onto my issues i am facing with my expense form.
I need to include all past Approvers onto the email notification.
On the expense form i have a reference fields called Approvers. In my Workflow i was able to get that approver selected in the form to be the approver of the request.
Once the approver has approve the request another email notification is sent to the finance dept.
I need to include the Approver who approve the request along with the date of which it was approved.
How can i do this?
i added this to my script but it doesnt seem to work
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);
while(gr.next()){
template.print('Details');
template.print(gr.getValue("approver") + " "+gr.getValue("state"));
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 01:08 PM
Hi @Peter Williams ,
Hope you are doing well.
Please try below script -
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('document_id', current.sys_id);
gr.addQuery("state","approved"); // Filter out only approved record if you want all comment this line
gr.query();
while(gr.next()){
template.print('Details');
template.print(gr.getDisplayValue("approver") + " "+gr.getValue("state") +"Approved Time "+gr.getDisplayValue("sys_updated_on"));
}
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 06:29 AM
Hi @Peter Williams ,
template.print(gr.getDisplayValue("approver") + " "+gr.getValue("state") +"Approved Time "+gr.getDisplayValue("sys_updated_on")+" "+gr.comments.getJournalEntry(1));
gr.comments.getJournalEntry(1) will fetch you the latest comment
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 01:08 PM
Hi @Peter Williams ,
Hope you are doing well.
Please try below script -
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('document_id', current.sys_id);
gr.addQuery("state","approved"); // Filter out only approved record if you want all comment this line
gr.query();
while(gr.next()){
template.print('Details');
template.print(gr.getDisplayValue("approver") + " "+gr.getValue("state") +"Approved Time "+gr.getDisplayValue("sys_updated_on"));
}
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 06:06 AM
Thank you that did it
Is there a way to get the Approved Comments also?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 06:29 AM
Hi @Peter Williams ,
template.print(gr.getDisplayValue("approver") + " "+gr.getValue("state") +"Approved Time "+gr.getDisplayValue("sys_updated_on")+" "+gr.comments.getJournalEntry(1));
gr.comments.getJournalEntry(1) will fetch you the latest comment
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 06:36 AM
amazing thank you