The Jira Automation Rule on Pull Request Approval automates actions in Jira based on pull request events. This rule enhances development workflows by updating Jira issues automatically. It connects code development with project management. This automation is important for maintaining accurate project status and improving team efficiency.
Jira Automation Rule on Pull Request Approval
Implementing an effective automation rule helps teams manage their development cycles more smoothly. Each step ensures that Jira tickets reflect the real-time status of code changes.
Adding Automation
Starting a new automation rule involves selecting the right trigger type. In your Jira project settings, find the automation section. Choose the “Branch, commit or pull requests” option. This category is specifically designed for integrating development activities with Jira tasks. This step begins your new Jira automation workflow.
Adding Trigger
The trigger defines when the automation rule will start. For pull request approvals, the “Pull request created” trigger is selected. This means the rule will activate every time a new pull request is opened. No further configuration is needed for this specific trigger. Simply save to proceed to the next step.
Adding Comment with Smart Values
After the trigger, an action is needed. Use the “Comment on issue” action to leave a message on the associated Jira ticket. Jira automation smart values are powerful tools here. They allow dynamic data from the pull request to be inserted into the comment. For instance, {{pullRequest.title}} and {{pullRequest.url}} can show the pull request’s title and direct link. Also, check “Prevent duplicates” to stop repeated comments.
Adding Issue Fields Condition
Conditions make the rule apply only when certain criteria are met. Add an “Issue fields condition” to the rule. Set this condition so that the “Status” field of the Jira issue equals “In Progress”. This means the rule will only apply to issues currently being worked on. Save this condition to target relevant tasks accurately.
Transitioning Issue Status
The final action in this automation updates the Jira issue’s status. Select the “Transition issue” action. Configure it to move the issue’s status to “In Review”. This automatically signals that the development work is ready for review. This keeps the project board updated without manual intervention.
Workflow of Jira Automation Rule on Pull Request Approval
Understanding the sequence and logic of setting up these rules is crucial. Each rule builds upon the previous one to create a seamless workflow.
Creating the Automation Rule
You start by creating a new automation within your Jira project. Access the “Add automation” button and select the “Branch, commit or pull requests” template. This establishes the foundation for linking code repository events with Jira issues. This is a common practice in modern DevOps environments.
Defining Trigger and Actions
The rule starts with the “Pull request created” trigger. This event then initiates a series of actions. First, a comment is automatically added to the linked Jira issue. This comment uses Jira automation smart values to provide context. Next, an “Issue fields condition” checks if the issue status is “In Progress”. If true, the final action transitions the issue to “In Review”. These Jira automation rules provide a clear workflow progression.
Jira Automation Examples
Here are a few examples of Jira Automation for your better understanding:
1. Transition Issue to “Ready for Merge” When PR Is Approved
Trigger: Pull Request Approved
Condition: Issue Type = Story / Bug
Action: Transition Issue → “Ready for Merge”
Why Use It:
As soon as reviewers approve the PR, the Jira issue moves forward automatically, keeping the board updated without manual intervention.
Workflow Example:
Developer opens PR → Reviewers approve it →
Jira automatically transitions the linked issue to Ready for Merge.
2. Add a Comment in Jira When PR Is Approved
Trigger: Pull Request Approved
Action: Add comment →
“PR #123 for this issue has been approved. Ready for merging.”
Why Use It:
This creates an automated activity log inside Jira, helping QA and PMs track development progress without checking GitHub/GitLab manually.
Workflow Example:
PR approved →
Jira adds an automated comment referencing PR and the reviewer.
3. Add a Label When PR Is Approved
Trigger: Pull Request Approved
Action: Add label → “pr-approved”
Why Use It:
Helps with filtering, dashboards, and development reports by marking issues that are past review.
Workflow Example:
PR approved →
Label added → Story appears in “Approved Code” reports.
FAQs
What is Jira Automation?
Jira Automation allows users to automate tasks and processes within Jira. It uses triggers, conditions, and actions to streamline workflows.
Why use Jira Automation for Pull Requests?
It improves efficiency by automatically updating issue statuses and providing real-time feedback. This reduces manual work and keeps teams informed.
What are Smart Values in Jira Automation?
Smart values are placeholders that dynamically pull data from Jira or linked applications. They allow for personalized comments and actions.
Can I set different conditions for the rule?
Yes, you can add various conditions, like checking specific fields or users. This makes the automation more flexible and powerful.
How do I debug an automation rule?
Jira provides an Audit Log for each automation rule. You can review its behaviour there to identify and fix any errors.
