Automation Rule and required fields question

Ann Rumenapp
Contributor
October 25, 2024

The business scenario is this:  A developer assigned to a card sets the 'Approver' field with the user to approve the card.  

Question 1: How do I ensure only the person in the 'Approver' field updates the Approval Decision and Approval Rationale fields?

Question 2: How to I force the Approval Decision and Approval Rationale fields to be required only after the 'Approver' field contains an approver?

Both of these can be done in a workflow transition, but the business did not like that option, so I'm hoping there is something in an automation rule that I can use.

2 answers

0 votes
Jovin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2024

Hey @Ann Rumenapp 

You could use an automation rule to achieve this. Meanwhile it doesn't make it read-only or required etc. it can help enforce things.

Automation Rule - Prevent Changes by Anyone Other than the Approver

This rule will prevent anyone other than the person in the Approver field from changing the fields you listed, in addition, if the Approver field is empty, it will also revert the changes.

  1. Trigger: Field Value Changed
    1. Fields: Approval Decision, Approval Rationale
    2. Operations: All
  2. Condition: IF/ELSE
    1. Configure it to be "At least one condition matches" (OR) 
    2. 1st Condition: {{smart values}} condition
      1. First value: {{issue.Approvers}}
      2. Condition: does not contain
      3. Second value: {{initiator}}
    3. 2nd Condition: Issue fields condition
      1. Field: Approver
      2. Condition: Is Empty
  3. THEN: Action: Edit issue
    1. Approval Decision: {{#changelog.customfield_XXXXX}}{{fromString}}{{/}}
    2. Approval Rationale: {{#changelog.customfield_XXXXX}}{{fromString}}{{/}}

You'll need to find the custom field ID for your fields, this can be found by going to edit the fields in your custom field configuration and looking at the ID in the URL, usually starts with 10xxx.

0 votes
Tomislav Tobijas _Koios_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2024

Hi @Ann Rumenapp ,

Just before diving into the topic, are we talking about approvals in Jira Work Management (now Jira) or approvals in Jira Service Management? Also, is a project in which you're using approvals company-managed or team-managed?

Another question - are Approval Decision and Approval Rationale custom fields on your site? I'm not aware there are any system fields named that (although I might be wrong). Also, what's the field type for each of these fields - paragraph, number...?

Cheers,
Tom

Ann Rumenapp
Contributor
October 25, 2024

The project is a company-managed project in Jira software.

Approval Decision is Select list, single choice, custom field (Options are Approve or Not Approved)

Approval Rationale is a text field, multi-line custom site field

Tomislav Tobijas _Koios_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2024

Ah, so it's a custom approval process.

Based on what I could gather from the info provided (and correct me if I'm wrong), not much can be done except using workflow to construct this. However, you could use self-reflecting transitions which would actually show up as Action on the issue view screen.

So, create a self-reflecting transition and add those two fields to it. Additionally, add a condition that user must be in this specific user picker field - 'Approver'. I guess you already got that part if talking about standard transitions. Regarding the fields, you can use either field configuration to set them as required, or workflow validator on this self-reflecting transition. Whichever works for you.2024-10-25_22-25-30.png 

Once that's done and after you select user in the user picker field, they should be able to view this 'transition' under Actions menu on the issue view.2024-10-25_22-30-47.png

This then opens up a screen that you've set up on the self-reflecting transition and that contains those fields you need:2024-10-25_22-33-20.png

Once the user hits "Update" button the changes will be saved and for the next part you can use either Automation to transition the ticket to another status, or this can be done manually (depending on the process). Other transitions from this, let's call it "Waiting for approval" status would have conditions related to "Approval Decision" field so transitions can be made only once the approver makes their decision. One notable resource/example on that can be found here.


As for 'automation-only', there is a manual trigger that can be partially configured but I don't think it would be sufficient enough. Similarly to the process mentioned above, you can create 'Approval action' from automation which is actually a manual trigger.

2024-10-25_22-39-01.png

Quite recently, they introduced an option that on manual trigger popup with customized fields opens up. These fields can also be set as mandatory if required.2024-10-25_22-39-16.png

The next thing here would be to connect those 'prompt fields' with Jira custom fields so the values are copied/mapped accordingly. This can be done by using smart values inside the automation rule.

However, as manual trigger configuration is limited, you cannot select that this action is only visible to the user selected in the user picker field. There's a feature request for this on JAC: https://jira.atlassian.com/browse/AUTO-744

Apart from these two ideas, natively I don't think there are any other options if you're using company-managed software project. In team-managed business projects (as stated in the comment above), you can set and configure approvals that look more like the ones in JSM.
Other than that, I guess Atlassian Marketplace would be a place to go in order to try to find an app that would fulfill business requirements.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events