Comala workflow multiple reviewer types for one approval
Asked by Marya Belanger:

I want to distinguish between two different reviewer types (defined as workflow parameters) but involve both types in a single approval.

Requirements:

* I need users in a group to be listed in a drop down in the Change State dialog the same way "list \| options" would be presented.
* I need to require at least 1 user from that list be chosen as a reviewer for the Technical Review approval.
* I need to also optionally allow that any other user (not from the group mentioned above) can also be added as a reviewer to the Technical Review approval
* Only the reviewer selected from the group's review is necessary to move the workflow forward.

What I'm trying is:

```
{workflowparameter:Required Reviewers|description=At least 1 Team reviewer must be assigned to review the page|type=list|options=GROUP_NAME|edit=true}

{workflowparameter}
{workflowparameter:Optional Reviewers|description=Other reviewers can optionally be assigned to review the page|type=user|edit=true}

{workflowparameter}
```

And the review/approval:

```
{state:Draft|submit=Review|taskable=true|colour=#4A6785|requiredparams=Author}
{state}

{state:Review|approved=Approved|rejected=Draft|taskable=true|requiredparams=Author,Required Reviewers}
{approval:Technical Review|group=&@Required Reviewers@|user=@Optional Reviewers@}
```

There are a couple problems:

* \[type=list\|options=GROUP_NAME\] just gives a dropdown list where the only item to choose is GROUP_NAME.
  * Selecting that option makes everyone in the group a required reviewer
  * We only want to require at least one person from the group
  * We want users to be able to scroll through a list of everyone in the group to choose
* Clicking "Submit" to move from "Draft" to "Review" pulls up the "Change state" prompt asking for the \[requiredparams=Author,Required Reviewers\]
  * The user isn't aware they can also choose to add optional reviewers unless they change state, click on the elipses, click on parameters, and then see the Optional Reviewers is a field.
  * We need to let them know at the same time they are choosing their one required reviewer from GROUP_NAME that they can also add reviewers from outside that group if they want.


Answers:
author: Matteo Gubellini _SoftComply_
body: Hi Marya,

Regarding the requirement to get at least one approver from the group yous should use **`selectedapprovers`** rather than "group". Without the "\&". This is enough to require the user to select at least one approver from the group.

For the optional approvers, I would create a parallel approval, still using **selectedapprovers=@Optional Reviewers@** and a trigger that will move the document to the next state if the required approvers approval is complete and there is nobody assigned to the optional approval.

Something like this:

```
{state:Review|approved=Approved|rejected=Draft|taskable=true}
   {approval:Approval|selectedapprovers=@Required Reviewers@}
   {approval:Approval OPTIONAL|selectedapprovers=@Optional Reviewers@}
{state}
{state:Approved|final=true|updated=Review|hideselection=true}
{state}
{trigger:pageapproved|approval=Approval|@Approval OPTIONAL>approvalassignees@=@Empty@}
   {set-state:Approved}
{trigger}
```

I haven't tested it with parameters but it should work.

Matteo


Tags: approver

comala

macro

workflow