Populate Demand Stakeholders from Business Unit, Department, and Business Application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 08:54 AM
Hi All,
I'm looking for some guidance on how to execute a business requirement. The requirement is to populate Demand's stakeholders based on the Business Unit, Department, Impacted Business Unit, and Business Application that is selected on the Demand form in addition to the Portfolio's stakeholder registry. We would want to populate the stakeholder list with the respective head/manager for each Business Unit, Department, etc.
Has anyone done something similar to this before?
- Labels:
-
Demand Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 11:09 PM
Hello,
For this requirement Department and Business unit head should be available in the Stakeholder Register Table.
Regards,
Namrata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 11:33 PM
Hello,
You can add the below code into existing Business rule "Populate Stakeholders based on Portfolio" and add the conditions like Department changes.
if(current.department!="")
{
var dp=new GlideRecord('cmn_department');
dp.addQuery('sys_id',current.department);
dp.query();
if(dp.next())
{
var mg=dp.getValue('dept_head');
gs.addInfoMessage("Department head is "+mg);
var grst = new GlideRecord('dmn_stakeholder_register');
grst.addQuery('active', true);
grst.addQuery('user',mg);
grst.query();
while(grst.next())
{
var uname=grst.getUniqueValue();
gs.addInfoMessage("stakeholder is "+uname);
var dmnst=new GlideRecord('dmn_m2m_demand_stakeholder');
dmnst.initialize();
dmnst.setValue('demand',current.sys_id);
dmnst.setValue('stakeholder',uname);
dmnst.insert();
}
}
}
Please mark my answer as helpful/correct if it helps you.
Regards,
Namrata.