Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Absent Member.. Jolie Good Absent Member..
Absent Member..
2626 views

build a variable of operator's approval groups

Jump to solution

to meet our change management approval needs, we have added an array to the assignment table that contains a list of approvers for each assignment.  each approver operator has the same change profile which puts them all in the same cm3groups record.  right now, all approvers are able to approve any change, and i need to add logic to limit approval capabilities based on assignment.  

 

my thought was to create a new variable in login.default that would hold all assignments that an operator is an approver for, then use that variable in my approval conditions.  if i make my query approvers=operator(), my variable contains the first assignment the operator is an approver for. if i make my query operator() isin approvers, my variable is null.  

 

i have a partial workaround that involves a query/calculation on the cm3r format control, but this only solves the issue of approval permissions.  i'm still left without a way to setup an inbox/view to show operators changes pending their approvals.

 

is there a different way for me to format my query on login.default or another solution altogether that could capture an operator's approval groups from the array in assignment?

0 Likes
1 Solution

Accepted Solutions
Absent Member.. Jolie Good Absent Member..
Absent Member..

Re: build a variable of operator's approval groups

Jump to solution

i found a solution, so i thought i'd share it.

 

 

add the following calculation to the login.default format control

 

calculation: $lo.approver.query="approvers=\""+$lo.user.name+"\""

add: true

 

 

add the following subroutine to the login.default format control

 

application name: build.list

names: query, name, names, string1, booleans, sort

values: $lo.approver.query, assignment, $G.approver.list, name, true, name

add/update/before: true

 

 

$G.approver.list holds all of the assignments the current operator is an approver for, and can be used in the display option conditions. then i set my inbox query

 

current.phase="Approval" and approval.status="pending" and assign.dept isin $G.approver.list and current.pending.groups isin approval.groups in $G.cm3r.environment and (releaseCandidate=NULL or releaseCandidate=false)

6 Replies
Highlighted
Absent Member.. John Stagaman Absent Member..
Absent Member..

Re: build a variable of operator's approval groups

Jump to solution

You can't use the OOB Approve option in the change queue, it requires that change profiles be configured as designed to assign approval privileges.

 

However, you can define a view which will display the changes pending approval instead of using the Approval display option. Request Management Quotes use this method OOB.

 

The view query would be similar to:

$lo.custom.approval.list isin current.pending.groups

 

If any of the groups in the first list are present in the current.pending.groups array, the matching records will be returned. You can look at the Quotes requiring my approval view to see an example of a similar query.

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
Absent Member.. Jolie Good Absent Member..
Absent Member..

Re: build a variable of operator's approval groups

Jump to solution

the trouble i'm having, though, is getting the variable populated with the approval groups.  once i have that, i think updating the inbox should be pretty straightforward.  any ideas how to get that variable filled in?

0 Likes
Absent Member.. John Stagaman Absent Member..
Absent Member..

Re: build a variable of operator's approval groups

Jump to solution

Update the login.DEFAULT format contol with a calculation to initialize the approval groups variable. The operator file is already the referenced file at login.DEFAULT.

 

So if your approval list added to operator field name is myApprovalGroups then:

$lo.myApprovalGroups=nullsub(myApprovalGroups in $file, {})

 

Note that this will not include the operator's ID (if they need to approve something specifically assigned to them as an approval. To add that to the variable, use a second calculation:

$lo.myApprovalGroups=$lo.myApprovalGroups+{$lo.user.name}

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
0 Likes
Absent Member.. Jolie Good Absent Member..
Absent Member..

Re: build a variable of operator's approval groups

Jump to solution

the operators are in an array in the assignment table.  i had thought about also creating a new array field in the operator table and trying to keep the approval info in sync between assignment and operator in the same way that the assignee values are kept in sync, but it seemed like it would be overly complicated to figure out how to cycle through each assignment group looking for the operator then adding or removing the assignment depending on the need and dealing with potential duplicates.

 

what about using javascript on login.default to cycle through all assignment records looking for the operator then adding the assignment to an array and assigning that to a variable?  i have no idea how to do that, but that could work, right?

0 Likes
Absent Member.. Jolie Good Absent Member..
Absent Member..

Re: build a variable of operator's approval groups

Jump to solution

i found a solution, so i thought i'd share it.

 

 

add the following calculation to the login.default format control

 

calculation: $lo.approver.query="approvers=\""+$lo.user.name+"\""

add: true

 

 

add the following subroutine to the login.default format control

 

application name: build.list

names: query, name, names, string1, booleans, sort

values: $lo.approver.query, assignment, $G.approver.list, name, true, name

add/update/before: true

 

 

$G.approver.list holds all of the assignments the current operator is an approver for, and can be used in the display option conditions. then i set my inbox query

 

current.phase="Approval" and approval.status="pending" and assign.dept isin $G.approver.list and current.pending.groups isin approval.groups in $G.cm3r.environment and (releaseCandidate=NULL or releaseCandidate=false)

MATPAT Super Contributor.
Super Contributor.

Re: build a variable of operator's approval groups

Jump to solution
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.