Needed to See RITM Approvals details in SCTASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi Team,
Am thinking to bring or to see the details - approvals of RITM in SCTASK in one of our workflow so our organization Engineers will get easy navigations to see details of approvals in SCTASK itself. Lets us know how we can achieve this by creating a new related lists or other options.
Regards,
Har**bleep**h K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @HarshithK
You can do it by creating one custom list type field referencing to user table on sc_task table and push the approvals in this field using Business Rule.
Sample Script:
var stbl = current.sysapproval.sys_class_name;
var grAprvl = new GlideRecord(stbl);
grAprvl.addQuery('sys_id', current.sysapproval);
grAprvl.query();
if(grAprvl.next()){
if(grAprvl.u_approvers.nil()){
grAprvl.u_approvers = current.approver;
}
else if(grAprvl.u_approvers.indexOf(current.approver) == -1){
grAprvl.u_approvers += "," +current.approver;
}
//con
if(current.u_approval_consultants!=""){
if(current.u_approval_consultants.includes(",")){
var con=current.u_approval_consultants.split(',');
for(var i=0;i<con.length;i++){
if(!grAprvl.u_approvers.includes(con[i])){
grAprvl.u_approvers += "," +con[i];
}
}
}else{
grAprvl.u_approvers += ","+current.u_approval_consultants;
}
}//con
//grAprvl.u_approvers="";
grAprvl.update();
}
here u_approvers is the custom field
If my response helped please mark it correct/helpful
Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
you can use defined relationship on sc_task and bring approval records
I shared solution for this some years ago, it has all the details
How to get approvers name on SCT task and also Short and Detailed description on REQ.
sharing here again
Steps on how to show Approvers related list on SC Task form
1) Left nav type relationships
2) Create new
3) Give some name
4) Applies to Table - sc_task
5) Queries from Table - sysapproval_approver
5) then use this script
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
current.addQuery('sysapproval', parent.request_item);
})(current, parent);
6) then save
7) now go on Catatog Task form
Configure related lists
9) search this and add and save
Output:
RITM Approval:
Catalog Task Approval: Showing the same details on SC Task Form
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Would you mind marking my response as correct as my solution worked for you?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Thanks Ankur
The above script and steps worked and Thanks for your responses.
Regards,
Har**bleep**h K