Trigger approval through workflow script to a group which is present in a custom table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 10:05 AM - edited 10-22-2024 10:06 AM
Hi All,
I have a custom table called portfolio which contains a field approval group which refers to group table. Also i have a catalog item which has a variable (reference type) which refers to Portfolio table. So i want when i select any Portfolio record in the catalog variable approval should go to the particular group which is present in that record. There is a existing approval group activity in workflow through which multiple approvals are getting triggered . So from there i need to trigger the approval to the groups.
Please let me know if more info is needed.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 03:47 PM
It would really help if you shared your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 10:11 AM
Hi @1_DipikaD
You can try the below script:
var portfolioSysId = current.variables.portfolio_variable_name;
var portfolioGR = new GlideRecord('portfolio');
if (portfolioGR.get(portfolioSysId)) {
var approvalGroup = portfolioGR.approval_group;
current.approval_group = approvalGroup;
}
Thanks and regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 01:42 PM
No doesn't work and not sure why you put current.approval_group = approvalGroup;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 02:15 PM
Hi @1_DipikaD
You can check the below Script:
answer=[];
answer.push(current.variables.variable_name);
I have tested in my PDI and it is working Fine.
Thanks and Regards
Sai Venkatesh