- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2017 06:59 AM
Hi All,
How to get CI service owner and requester's manager as approvers in workflow approval activity for a catalog Item.
Catalog Item has application variable which captures CI's and employee variable for requester.
If CI's service owner is missing then it should check for service category owner , if that is also blank then it should check Service Executive. All these are fields in cmdb_ci table.
Any suggestion or code assistance will help me a lot.
thanks
PlatformDeveloper CommunityDeveloper CommunityDiscussDevelopCommunity Corner
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2017 07:55 AM
Thanks Chuck! It's working
Here is the final code!
function getServiceOwner(){
var user = new GlideRecord('cmdb_ci_appl');
if(user.get(current.variables.application)){
if (!user.managed_by.nil()) {
//gs.log("manger" + user.managed_by );
answer.push(user.managed_by);
} else if (!user.owned_by.nil()) {
answer.push(user.owned_by);
//gs.log("owner" + user.owned_by );
} else {
answer.push(user.u_service_executive);
//gs.log("service owner" + user.u_service_executive);
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2017 07:20 AM
Instead of retrieving the record from cmdb_ci in your script, retrieve it from cmdb_ci_appl and you'll have your field available and value populated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2017 07:55 AM
Thanks Chuck! It's working
Here is the final code!
function getServiceOwner(){
var user = new GlideRecord('cmdb_ci_appl');
if(user.get(current.variables.application)){
if (!user.managed_by.nil()) {
//gs.log("manger" + user.managed_by );
answer.push(user.managed_by);
} else if (!user.owned_by.nil()) {
answer.push(user.owned_by);
//gs.log("owner" + user.owned_by );
} else {
answer.push(user.u_service_executive);
//gs.log("service owner" + user.u_service_executive);
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2017 07:56 AM
Glad you go it working. Thanks for sharing the final solution. Happy to help.