- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2015 11:35 AM
Hi All,
I am trying to develop a way for non-itil users to see their respective employees tasks and incidents. Our instance pulls manager information from AD. I do not want to add additional licenses for this (so no role will be given to the manager); also I do not want to change all our ACL's for the managers to view the information. I believe the best way to do this is to provide a report that is emailed to the manager with the Incidents and Tasks associated to that manager's employees. We would like this to be a service catalog item that is automatically completed. Is there a way to trigger a report from a workflow? Running the report manually I can use caller.manager = the manager's name. How can I pass the variable from the workflow script to the report? Also, I would need the report to ultimately be emailed to the manager.
I appreciate your help!
Amber
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2015 08:02 AM
Unfortunately, you will not be able to use the manager's ID dynamically in a normal report. However, seeing as you want to email the results to the managers anyways, this post may help you out - Using Email Notifications as Custom Reports
Instead of creating a Scheduled Job, you can fire the event from your catalog item, or maybe create a Record Producer to save you from creating a workflow as well. Record Producers can be configured to not actually create a record - Use a Record Producer to NOT CREATE A RECORD. That may be better as your managers can request a report and you will not have Requests, Requested Items and Workflows being created for nothing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2015 08:02 AM
Unfortunately, you will not be able to use the manager's ID dynamically in a normal report. However, seeing as you want to email the results to the managers anyways, this post may help you out - Using Email Notifications as Custom Reports
Instead of creating a Scheduled Job, you can fire the event from your catalog item, or maybe create a Record Producer to save you from creating a workflow as well. Record Producers can be configured to not actually create a record - Use a Record Producer to NOT CREATE A RECORD. That may be better as your managers can request a report and you will not have Requests, Requested Items and Workflows being created for nothing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 08:22 AM
Thanks Jim for pointing me in the right direction. I have decided to use email notification to email the custom report. All is working except for a piece of the query "gr.addQuery('caller_id.manager.name','current.requested_for.name');" I believe it is an issue with the variable name of the Requested For since it works if I put in a person's name there. Could someone clarify what the variable name should be?
Self-Service Workflow:
Creates Task with the short description: Manager Report
Notification details:
table:sc_task
when: Short Description: Manager Report
<mail script>
baseUrl=gs.getproperty("glide.servlet.uri");
var gr=new GlideRecord("incident");
gr.addQuery('active','true');
gr.addQuery('caller_id.manager.name','current.requested_for.name');
gr.orderBy('caller_id.user_name');
gr.setLimit(15);
gr.query();
if (gr.getRowCount() > 0)
{template.print(gr.caller_id.user_name + "<br/>");
while (gr.next())
{template.print(gr.caller_id.user_name + "</a> - " + gr.getDisplayValue('sys_created_on') + " - <a href='" + baseUrl + gr.getLink() + "'>" + gr.getValue('number') + "</a> - " + gr.short_description + "<br/>");
}
}
<mail script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 08:38 AM
Try removing the quotes around the "current.requested_for.name" string:
gr.addQuery('caller_id.manager.name',current.requested_for.name);
You are literally sending "current.requested_for.name" as the name to look for instead of the field value. And I'm wondering if it should be current.requested_for.manager.name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 09:09 AM
That worked!!
The reason I am feeding in the requested for as the caller's manager is because this will be requested by the manager in the self-service portal. Therefore the requestor (requested for) will also be the caller's manager.