Select Approvers automatically based on a field value in Jira Forms
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
The requirement is to set the Approver field automatically based on a field value in Forms.
Environment
Jira Service Management
Diagnosis
Currently, there is no option to use the Form field directly with Jira Workflow or with Jira Automation.
Solution
You can link a Form field with Jira Custom field and use it to capture the value from Forms, and then use Automation to set the Approver field based on the value set on this custom field.
Below are the detailed steps for this solution:
For illustration purposes, we are using the Select List (single choice) custom field, you can opt to choose a different field that would suit your requirement.
Create Form and Custom field, set context and default values in the Custom field and link it to the Form Field.
- Create a Form and add all necessary fields to the Form.
- Now create a Custom Field or use the existing custom field of the same field type as created in the Form.
- Add Context and Default values in Jira custom field with the values that you want to see under the selected form field.
- Open the Form and link the custom field with a form field, a
Warning screen will Pop-Up, and here select the option Replace Choices.
All the values selected in the Form field will now be automatically copied to the Linked Custom Field. - Next, add the Form to the Request Type
Configure the Approval step in Workflow and modify Approver based on values selected in Jira Form field.
- Go to your Service project and open Workflow(Project Settings > Workflow)
- Select the workflow that is linked to the required Request Type.
- Edit the workflow and add the Approval step in the preferred Workflow Status.
- Select the Number of Approvers and Approver Source.
- Publish the Workflow and select No under Save a backup Copy and click on Publish.
Create the below Automation rule to set Approver based on values from the Linked Jira Custom Field.
Navigate to Project Settings > Automation and Create a Rule with the following components:
- Trigger: Issue Transitioned (You can select another Trigger based on your requirements)
- Add a Condition: IF, ELSE condition option
Choose the Issue fields condition for the IF branch:
Under the IF branch click on Add component, choose Add a Action and select Edit Issue
You can also configure an additional action to send emails to the Approvers with the Send email action like below: - Additionally, you add multiple IF-ELSE branches for different values of the field and set the Approvers field accordingly.
In case you need further support on this, please feel free to contact support via the Atlassian Support Portal.