/
Administration

Administration



Jira system admins have to do a lot within larger companies and cannot take care about individual projects out of hundreds. Therefore, you can setup and configure all necessary sign-off/approval-rules for my app "Group Sign-Off/Multi-Approvals for Jira" as project administrator, now: such rule for sign-off/approval will be stored as a default value within a new context of the related custom field for the maintained project only. Additionally, all screens will be adjusted to also contain this Group Sign-Off field except for the screen of the issue-create-operation.








Global settings

Within the app's global configuration, you can specify some overall behaviors/features as shown below:

As a system admin, you can reach that panel by clicking on the button "Configure" of the expanded section "Group Sign-Off for JIRA" on your Jira page "Manage apps".



Create additional customfield(s)

Please create any many new customfields of type "Group Sign-Off" as you need, like "Steering Committee", "Product Board" etc. Within this documentation, I am focussing on one new customfield named "Sign-Off". If you are not familiar with creation of new customfields, please have a look at the Atlassian documentation for this standard feature of JIRA.

In order to get the related unique ID of your new customfield, please click on the "configure" menu item as visible on the screenshot.

Within the URL, you will find the unique ID of your customfield as parameter, here: 10100. Please write it down to remember. You will need it while configuring listeners later.

You have to determine, who is allowed to make a decision. Using the feature of setting a default value of a customfield, you can define it once and it will be taken over while creating a new issue automatically.

A definition of a decision is divided into two parts and stored as value within the related customfield:

  • the list of responsible users being able and allowed to decide and

  • a rule to determine the final result of the decision.


The list starts at the first character, first line with the login name of the responsible user: one user per line. Each line has to be terminated by a line-break. If the login name is unknown, it will not be displayed on the screen. The list of users end with a blank line for a better overview.

The rule for the decision starts with "sign-off=" followed by a boolean expression. Internal validation of the rule will be done by replacing all login names by their related decisions (sign-off = true and decline = false, pending = nothing). As soon as this rule results in a final TRUE or FALSE, it triggers the configured listener (see below). Having no individual decisions at the beginning or necessary pending ones, the result cannot be determined and nothing happens. The boolean expression can contain brackets "(" and ")" as well as "AND" and "OR" to describe the relationship of individual decisions. If the IT-boss or her/his representative can decide, one of both sign-offs is enough, and the business product owner has to sign-off as well the rule would be like: (boss OR representative) AND productOwner.

Simple Example of a definition

fpolscheit
representative

sign-off=(fpolscheit OR representative)

 If you want to put additional information in front of the user name, you can add this as comment straight after the user name without any spacing and enclosed by /* and */. Attention: you have to use the combination of name and comment as a unique identifier within the sign-off rule. Background: you may have different roles and act in different contexts.

Simple Example with additional user infos

fpolscheit/*Manager*/
representative/*Alternative Voting by*/

sign-off=(fpolscheit/*Manager*/ OR representative/*Alternative Voting by*/)











Dynamic Rule(s) for more complex but flexible approaches

Instead of explicitly declaring a list of users and a sign-off rule using boolean algebra, you can specify a dynamic rule coded in JavaScript and using provided helper functions, which extract the users out of referred other custom fields like single- or multi-user pickers, etc. A dynamic rule MUST start with a first line just containing "// conditional rule". Then, users and a rule have to be defined as described below.

The reserved words in blue within the following complex example are mandatory within a dynamic rule!
Within a condition, you can use all methods provided by JIRA's issue API. The helper object provides the following methods:

  • contains(collection, string)

  • contains(collection, id as number)

  • getCF(issue, customfieldName)

  • getCFms(issue, customfieldName) to retrieve a customfield's value in milliseconds

  • getUsersByCustomfield(issue, customfieldName, operand) to retrieve a (list of) user(s)

  • getUsersByProjectRole(issue, JiraProjectRoleName, operand) to retrieve a list of users

  • getUsersByGroup(issue, JiraGroupName, operand) to retrieve a list of users

  • getIssueByCurrentKey(issueKey) - available since version 2.8

  • concat(list, operand) to append a list of users using logical operand like "AND" or "OR" within a rule definition and "," within user definition

  • log(data) to write data into JIRA's logfile.

If you are using getUsersByCustomfield(), getUsersByProjectRole(), getUsersByGroup() the name of the referred element (custom field, project role or group) will be displayed in front of the retrieved user name since Group Sign-Off version 1.4.0.



Complex Example with different syntax: use a customfield (multi-user or user picker) to dynamically specify voters

// conditional rule

users =""+helper.getUsersByCustomfield(issue,"Board Members",",");
rule =""+helper.getUsersByCustomfield(issue,"Board Members","OR");



Please use the exact syntax above for dynamically specifying the list of user(s) based on the referred custom field. Users must be a comma separated list, that why the operand is a comma. The rule must be a sequence of users, concatenated by a boolean operand (AND or OR). By the first voting, the content of the customfield, referenced by name as parameter, will be taken over and the members will become a fix list.

Instead of using the custom field's name, you can also use it's ID: please put that number into the quotes like "10023" instead of "Board Members".



Or you can get the value of a cascading-select-customfield and determine the deciders and their logic per field value:

Within this sample, the custom field named „myCascadingSelection“ has got the options A-1, A-2, B-I, B-II …



You can also access the following functions of an issue (similar to the functions officially provided by the Atlassian Java API):

  • issue.getReporter()

  • issue.getPriorityObject()

  • issue.getFixVersions()

  • issue.getComponentObjects()

Within the following sample, the issue's reporter is automatically retrieved and used as a decider this for approval:



Often, you do not want to see a group sign-off field and its approvals through the complete life-cycle of an issue: you can limit displaying a group sign-off field only if its issue is within a certain status.



Suppose you use multiple custom fields to retrieve all users, who have to decide all together: in this case, you have to concatenate the custom fields' content and use a logical operator within the dynamic rule. The sample below illustrates a proper definition.

All members of the custom field "Managers" will be appended but if there is at least one user, only.
BUT: this rule works fine as long as the custom field "Board Members" is not empty! In this case, the user list would start with a leading "," as a result of the appended/concatenated managers, which forces a syntax error. To avoid this, ensure that users and rules are not empty when appending data by calling the function concat() or get rid of leading operators afterward, alternatively. This second approach is used within the following sample:

Since Group Sign-Off version 2.8, you can access an issue's fields a bit easier, just using Javascript-llike JSON-notation like issue.status.name.

Or you can get the value of a single-select-customfield and determine the deciders and their logic per field value:



Or you can get the value of a cascading-select-customfield and determine the deciders and their logic per field value:

Within this sample, the custom field named „myCascadingSelection“ has options A-1, A-2, B-I, B-II …

 

The following code sample is a generic template to concat all members of referenced custom fields (single- or mutli-user pickers) as well as referenced Jira group(s):

 

Advanced feature for experienced power-user:

DEPRECATED due to security aspects and removed in Group Sign-Off version 2.8:

  • in addition to the object issue, you can read other issues rather than the current issue by using all methods of issueManager (click to jump to Atlassian's API docu) since app version 2.5.0 of Group Sign-Off for Jira Server/DataCenter. Since Group Sign-Off version 2.5.9, the methods of issueServiceissueLinkManager as well as user are also available.

Using these advanced features, you can configure suitable solutions for even more complex business scenarios.

INSTEAD, please use:





Pay attention: using a dynamic rule, it's resulting set of deciders will be automatically turned into a static equivalent by the first decision for integrity reasons!

Background information: if someone has voted (declined or signed-off) and the members of a decision would be changed later, you can manipulate the total result by removing deciders with unwanted votes or add additional deciders. To avoid this, an automatic transition into a fix set of deciders will be done together with the first vote.

Additional Options

Additional options can be added at the end of the definition like shown below.
ATTENTION: put an option per line and do not terminate by a semicolon.

Vote/decide multiple times revoking prior one

  • optionOnce=false|true(is default) : decide and reverse decision multiple times if set to false

Vote/decide multiple times revoking prior one - but limited to revert declines, only

  • optionRevertDeclines=true|false(is default): decide and be able to reverse declines later, multiple times if set to true!

Disable delegation of decisions

  • optionDelegation=false|true(is default) : prevent from delegation by deciders (available in v1.4.2.2 for JIRA 6)

Confirm decision by entering password again (re-authenticate)

  • optionReAuthenticate=true : require re-authentication by entering the user's password again to confirm (available since v1.4.7 for JIRA 7)

Disable forcing a comment if having declined

  • optionNoCommentIfDecline : by default, if a decider declines, a comment is forced to justify, but using this option, it is ignored

Mandatory comment if having declined (since version 2.10.4 for Jira 10 or 2.8.24 for Jira 9)

  • optionMandatoryCommentIfDecline : by default, a decider having declined can skip entering a comment (keep the comment field empty). Having set this option, a decider is forced to enter a comment justifying the decline.

Overwrite standard behavior to reload an issue after deciding

  • optionNoReload : by default, an issue is reloaded after deciding to properly display its status etc., which may have changed by that decision by configured listeners or workflow post functions in the background.

Disable displaying individual users

  • optionDisplayNoUsers : by default, all users being identified as deciders are displayed including their voting, but using this option these details are omitted:
    As admin, you will see all users' decisions independent from this option setting, so that you will get all necessary information for justifications if a result is regarded in doubt.
    As decider, you will see just your own decisions or both buttons "sign-off" and "decline".
    As normal user, you will see each role (like the name of the referenced customfield or project role in case of dynamic rules) and their sum of decisions including related timestamps but without details about individual deciders and their concrete decisions.

Display decision buttons for deciders only if their decision has got an immediate and direct effect on the total result

  • optionDecisionWithEffectOnlyby default, all deciders will see the buttons for declining or signing off. If you want to reduce that just for deciders, whose decision has got an immediate effect on the total result then use this option (available since v1.6.6) depending on the complexity of your dynamic rule. In that case, a decline as well as a sign-off decision of the current decider will be simulated: if that forces a change of the total result, e.g. switching from "pending" to "signed-off" or "declined". If your dynamic rule contains e.g. "(user1 AND user2)", then it does not make sense as user1's decision will have no effect until user2 has signed-off. So, usage highly depends on your sign-off rule for specific cases!

Option for "maybe/uncertain" (available since version 2.8.6)

  • optionMaybe=true : allow voting "maybe/uncertain" as an alternative for "sign-off/approve" and "decline" to indicate the necessity of e.g. additional information and to differentiate from "pending".