Approved Condition base on users/groups

Customer Requirement

We have 3 groups: A, B and C.

An user can belong to both A and B while an user in C won't be in A and B.

We need to have 4 approvals total and at least 1 approval from each group: A, B, C. 

During off hours, between 11pm to 5am, we only need at least 1 approval from each group.

How to implement the customer scenario

(info) Case of an user belonging to group A and B, his approbation will be considered taken for group B if any other user that belongs to group A has approved, is considered taken for group A if any other user that belongs to group B has approved

Step 1 -  Create the User picker custom field (multiple users) that will be filled with the final list users allowed to approve.

  • Create three User Picker multiple users:
    • User Picker (Group A-B)
    • User Picker (Group B-A)
    • User Picker (Both A B).
 Create the User Picker Custom Fields

You can review instruction to create a custom field on the related Atlassian documentation.

You do not need to add this custom field to any Screen and you do not need to specify any Context.

Step 2 - Create the Approval configurations to identify approvers

 Create the Approval Configuration for Approval User Picker (Group A-B)
  1. Navigate Add-ons → HERZUM APPROVAL →Approvals.
  2. Click the Add Approval button.
  3. Fill the Add Approval Configuration form
  4. Fill the User Picker Field All by selecting the Approving Users with Exclusion User Picker custom field

  5. Click
  6. Specify the expression to populate the custom field
  7. You are able test the expression on an issue in order to check its correctness as per following examples
  8. Save the Expression
  9. Save the Approval configuration
 Create the Approval Configuration for Approval User Picker (Group B-A)
  1. Navigate Add-ons → HERZUM APPROVAL →Approvals.
  2. Click the Add Approval button.
  3. Fill the Add Approval Configuration form
  4. Fill the User Picker Field All by selecting the Approving Users with Exclusion User Picker custom field

  5. Click
  6. Specify the expression to populate the custom field
  7. You are able test the expression on an issue in order to check its correctness as per following examples
  8. Save the Expression
  9. Save the Approval configuration
 Create the Approval Configuration for Approval User Picker (Both A B)
  1. Navigate Add-ons → HERZUM APPROVAL →Approvals.
  2. Click the Add Approval button.
  3. Fill the Add Approval Configuration form
  4. Fill the User Picker Field All by selecting the Approving Users with Exclusion User Picker custom field

  5. Click
  6. Specify the expression to populate the custom field
  7. You are able test the expression on an issue in order to check its correctness as per following examples
  8. Save the Expression
  9. Save the Approval configuration
 Create the Approval Configuration for Group C
  1. Navigate Add-ons → HERZUM APPROVAL →Approvals.
  2. Click the Add Approval button.
  3. Fill the Add Approval Configuration form
  4. Fill the Group property by selecting the Group C

  5. Save the Approval configuration

Step 3 - Create the Conditional rules

 Create the Conditional Rule At least 1 approval from each Group during business hours
  1. Navigate Add-ons → HERZUM APPROVAL →Conditional  Rules.
  2. Click the Add Conditional Rule button.
  3. Fill the Rule Name
  4. Fill the Conditional rule 
    (issue in approvedApproval("Approval User Picker (Group B-A)", 1) AND issue in approvedApproval("Group C", 1))
    OR
    (issue in approvedApproval("Approval User Picker (Group A-B)", 1) and issue in approvedApproval("User Picker (Both A B)", 1) AND issue in approvedApproval("Group C", 1))
    OR
    (issue in approvedApproval("Approval User Picker (Group B-A) ", 1) AND issue in approvedApproval("User Picker (Both A B) ", 1) AND issue in approvedApproval("Group C", 1))
    OR
    (issue in approvedApproval("User Picker (Both A B) ", 2) AND issue in approvedApproval("Group C", 1))

  5. Save the Conditional Rule configuration
 Create the Conditional Rule At least 1 approval from each Group during OFF hours
  1. Navigate Add-ons → HERZUM APPROVAL →Conditional  Rules.
  2. Click the Add Conditional Rule button.
  3. Fill the Rule Name
  4. Fill the Conditional rule 
    (created >= startOfDay('+23h') and created <= startOfDay('+24h')) or (created >= startOfDay() and created <= startOfDay('+5h')) and ((issue in approvedApproval("Approval User Picker (Group A-B)", 1) and issue in approvedApproval("Approval User Picker (Group B-A)", 1) AND issue in approvedApproval("Group C", 1))
    OR
    (issue in approvedApproval("Approval User Picker (Group A-B)", 1) and issue in approvedApproval("User Picker (Both A B)", 1) AND issue in approvedApproval("Group C", 1))
    OR
    (issue in approvedApproval("Approval User Picker (Group B-A) ", 1) AND issue in approvedApproval("User Picker (Both A B) ", 1) AND issue in approvedApproval("Group C", 1))
    OR
    (issue in approvedApproval("User Picker (Both A B) ", 2) AND issue in approvedApproval("Group C", 1)))

  5. Save the Conditional Rule configuration

Step 4 - Create the Approval Mapping configuration 

 Create the Approval Mapping
  • Navigate Add-ons → HERZUM APPROVAL →Approval mappings Administration.
  • Click the Add Approval  Mapping button.
  • Fill the Add Approval Mapping form with the Project and the Issue Type

  • Select the workflow status that needs the approvals, the workflow transition and the destination workflow status when approved. 

  • Drag and drop the needed approvals from the list of Available Approvals in the list of Requested Approvals.
  • Setup Minimum Required approbations/rejections based on conditions

  • Save the Approval Mapping configuration



In this section

Related Documentation

Here you can find some links to our customer documentation relating to the configuration screens  addressed in this page:

Still need help?

We would love to help.