Outage Approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 01:46 AM
Hello Team,
I have one requirement where Needs to be trigger the approval to affected cis and Affected Servicers on the basis selection on Assignment group and Outage box is checked.
Here I am able to trigger the Approval to Affected Cis and Affected Services of owned by , managed by and Approval Group .
I am able to trigger the approval however when i it comes to the condition assignment group and Outage box is true not able to trigger the
approval for affected Cis and Affected Services owned by , managed by .
Here in workflow we added activity as approval coordinator and in that we write script .
Approval - User :-
var answer = [];
var a = current.sys_id;
var gr = new GlideRecord('task_ci');
gr.addEncodedQuery('task=' + a);
gr.query();
while (gr.next()) {
// var ap = gr.ci_item.change_control;
var owned = gr.ci_item.owned_by;
var mana = gr.ci_item.managed_by;
if (owned != '') {
answer.push(owned);
}
if (mana != '') {
answer.push(mana);
}
}
var gr1 = new GlideRecord('task_cmdb_ci_service');
gr1.addEncodedQuery('task=' + a);
gr1.query();
while (gr1.next()) {
//var ap1 = gr1.cmdb_ci_service.change_control; //.getDisplayValue()
var owned1 = gr1.cmdb_ci_service.owned_by;
var mana1 = gr1.cmdb_ci_service.managed_by;
if (owned1 != '') {
answer.push(owned1);
}
if (mana1 != '') {
answer.push(mana1);
}
}
Approval to Group :-
var answer = [];
var a = current.sys_id;
var gr = new GlideRecord('task_ci');
gr.addEncodedQuery('task=' + a);
gr.query();
while (gr.next()) {
var ap = gr.ci_item.change_control;
if(ap != '')
{
answer.push(ap);
}
}
var gr1 = new GlideRecord('task_cmdb_ci_service');
gr1.addEncodedQuery('task=' + a);
gr1.query();
while (gr1.next()) {
var ap1 = gr1.cmdb_ci_service.change_control; //.getDisplayValue()
if(ap1 != '')
{
answer.push(ap1);
}
}
Please Help me to get sorted as we need to trigger this approval on Change table for
affected CIs and Affected Services owned by , managed by , approval group on the basis of Assignment group and Outage box true in change ticket .
if we need to modify the script how we can modify this .
Any help to appreciate .
Thank you.