You can use automation in Jira to approve or reject an approval based on comment logged on the Jira issue. To do this, please follow the below mentioned steps:
Go to the automation section in Jira and Create a new rule.
Select the trigger as Issue Commented and select Comment type as “All comments“
Add a condition “Issue Fields“ and select Field “Issue Type“ Condition “Equals“ and Value “<Issue-type>“ : Add the condition to select the issue type on which you wish to run the automation rule.
Add “if “ condition
A sample automation rule will look like:
Add smart value as:
{
"fields": {
"EA4J Auto Approver Custom Field": {
"approveReject": true,
"user": "{{ACCOUNTID}}",
"rule": "ed6b9d2a-d529-4b20-a90c-9f085640b1e8"
}
}
}Here, "approveReject": true means approve; "approveReject": false means reject.
“rule“ should have the ID of the automation rule which needs to be executed.