On your Jira projects page, click the Add automation button and select the Branch, commit or pull requests automation.
Step 2. Add a trigger
In the New trigger list, search for and select the Pull request created trigger. Since there is no configuration needed for this trigger, click the Save button to continue.
Step 3. Add a comment
Next, add an action to the rule that leaves a comment on the issue. Search for and select the Comment on issue action from the list. Configure it with a comment message. In the comment message, smart values allows you to access and manipulate data. In the following example, smart values are used to populate the pull request title and URL.
Be sure that “Prevent duplicates” is checked. This helps prevent the rule from spamming the issue with duplicate comments. Once you have a comment message configured, click Save.
Step 4. Add a condition
Next, add a condition to the rule so that it targets “In Progress” issues. Search for and add Issue fields condition to the rule. Configure the condition so the status field equals “in progress”. Click Save.
Step 5. Transition the issue
Next, transition the issue to “In Review”. Add a new action component and search for and select the Transition issue action.
Configure the Transition issue action so it updates the issue status to “In Review”. Once configured, click Save.
The final rule summary should look like:
When a pull request is created, comment on the attached issue. If the status is “In Progress”, move it to “In Review”. This helps keep Jira issues updated when developers actively work on issues. Enter a name for the automation rule and click Turn it on to activate.
Once activated, trigger this rule by creating a Jira issue and push a commit to GitLab that references that commit. Visit the automation Audit log to review the rule’s behaviour or debug any errors.
This rule is a good foundational rule for other advanced pull request rules. Be sure to check out hundreds of other rules in our Automation Template Library.
Kev is a lead full stack web developer and serial entrepreneur with over a decade of experience building products and teams with agile methodologies. He is a passionate contributor, author, and educator on emerging open source technologies like DevOps, cryptocurrency, and VR/AR. In his free time, he participates in indie game development jams.