I have some questions before describing the whole solutions:
- How are the 4 users who 'sign-off' the issue determined? Do you use 4 different project roles, or are they preset in certain custom field?
- Is the 'sign-off' done when the issue is in certain unique status? In case the issue can be in more than one status, how many?
- Do you find desirable to restrict certain transitions until the issue has been approved (i.e, signed-off by the 4 users)?
Now, I explain how to implement the solution in 9 steps:
1) Create 5 project roles: "Region A Approval", "Region B Approval", "Region C Approval", "Region D Approval" and "Bypass Approvals".
2) Create a check-boxes custom field called "Approval", with 4 options: "Region A", "Region B", "Region C" and "Region D". In this example "Approval" custom field has field code %{14203}, but it depends on each particular JIRA instance.
3) Include custom field in view screen, but not in create and edit screens.
4) Insert 2 reflexive transitions (same source and destination status) in each of the statuses from which approvals are allowed to be done: "Approve Issue" and "Revoke Approval".
5) Insert "Boolean condition with math, date-time or text-string terms" condition in all "Approve Issue" transitions, using the following configuration:
Boolean expression used is:
isInRole(%{00020}, "Region A Approval") AND "Region A" not in %{14203} OR isInRole(%{00020}, "Region B Approval") AND "Region B" not in %{14203} OR isInRole(%{00020}, "Region C Approval") AND "Region C" not in %{14203} OR isInRole(%{00020}, "Region D Approval") AND "Region D" not in %{14203}
Notice that:
6) Insert "Set a field as a function of other fields" post-function in all "Approve Issue" transitions, using the following configuration:
Setting rules used are:
[isInRole(%{00020}, "Region A Approval") AND "Region A" not in %{14203}]+ Region A
[isInRole(%{00020}, "Region B Approval") AND "Region B" not in %{14203}]+ Region B
[isInRole(%{00020}, "Region C Approval") AND "Region C" not in %{14203}]+ Region C
[isInRole(%{00020}, "Region D Approval") AND "Region D" not in %{14203}]+ Region D
7) Insert "Boolean condition with math, date-time or text-string terms" condition in all "Revoke Approval" transitions, using the following configuration:
Boolean expression used is:
isInRole(%{00020}, "Region A Approval") AND "Region A" in %{14203} OR isInRole(%{00020}, "Region B Approval") AND "Region B" in %{14203} OR isInRole(%{00020}, "Region C Approval") AND "Region C" in %{14203} OR isInRole(%{00020}, "Region D Approval") AND "Region D" in %{14203}
8) Insert "Set a field as a function of other fields" post-function in all "Revoke Approval" transitions, using the following configuration:
Setting rules used are:
[isInRole(%{00020}, "Region A Approval") AND "Region A" in %{14203}]- Region A
[isInRole(%{00020}, "Region B Approval") AND "Region B" in %{14203}]- Region B
[isInRole(%{00020}, "Region C Approval") AND "Region C" in %{14203}]- Region C
[isInRole(%{00020}, "Region D Approval") AND "Region D" in %{14203}]- Region D
9) Insert "Boolean validator with math, date-time or text-string terms" validator in transition "Start Development" with the following configuration:
Boolean expression used is:
numberOfSelectedItems({14203}) = availableItems({14203}) OR isInRole(%{00020}, "Bypass Approvals")