How to create report of RITMs with skipped approval in which workflow is used?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
RITMs with Skipped Approval
1. Create a script include named 'RITMSkipped', make sure to enable Client Callable and SandBox Enabled
Code:
var RITMSkipped = Class.create();
RITMSkipped.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getRITMSkipped: function() {
var skippedRITM = [];
var gr = new GlideRecord('wf_history');
gr.addQuery('result', 'skipped');
gr.query();
while (gr.next()) {
var wfContextGR = new GlideRecord('wf_context');
if (wfContextGR.get(gr.context)) {
var wfContextSysId = wfContextGR.getValue('sys_id');
var wfContextID = wfContextGR.getValue('id'); // The 'ID' field of wf_context
var numRITM = new GlideRecord('sc_req_item');
numRITM.addQuery('sys_id', wfContextID);
numRITM.query();
while (numRITM.next()) {
skippedRITM.push(numRITM.sys_id.toString());
}
}
}
return skippedRITM;
},
type: 'RITMSkipped'
});
2. Go to Reports> Create New> 'sc_req_item' as table>Type as list>configure columns as per need>filter using sys_id 'is one of' javascript: new global.RITMnoApprover().getRITMnoApprover()
Kindly mark it as helpful or drop a comment in case of any doubts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
apologies... In step 2, use "javascript: new global.RITMSkipped().getRITMSkipped()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Please add the prefix “Blog / Article” so it is easy to identify whether the content is an issue or informational.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
I am unable to do it, I read somewhere that I need to be member of rising star community to post in blog...
😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Add prefix in title. You are right, RS/MVP can write blog as of now.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
