Hey there,
I wanted to create an automation regarding the following:
- When a Pull Request is created, post a comment with the URL of the Pull Request into the comment of the Jira issue
- If a Code Reviewer is already added, mention the Code Reviewer in the comment too.
We have the following field (?) in the Jira Screen that already shows that there is a pull request but it would also be needed in the comment.
Maybe someone has a easy solution for this :)
Thank you already in advance!
-Vanessa
options you could try:
Use an automation rule triggered by an incoming webhook from your Git provider when a PR is opened, then add a comment to the Jira issue containing the PR URL.
If you're using GitHub or Bitbucket, check whether their Jira integration exposes smart values for pull requests that can be used in Automation.
Mentioning the reviewer is possible if the webhook payload includes reviewer information, e.g. @ReviewerName.
We've implemented something similar using webhooks + Jira Automation, and it works quite reliably. I'd be interested to hear which Git provider you're using, as the setup differs a bit between GitHub, GitLab, and Bitbucket. tried something similar on jobyzo.com
Hope this helps! 🙂
Hi @Vanessa
You can create a simple automation, for example (first part is optional):
Hi [~accountId:{{assignee.accountId}}],
A new PR is ready for you {{pullRequest.url}}!
You can read more about development smart values here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
to the answer of of @Patrik Korovsky i‘d like to add:
The reviewer of a PR could be another person than the assignee. The reviewer is something living within the repository and is not connected to any increment in Jira (not even a user —> could be at least it doesn‘t have to).
Furthermore there is no smart value to retrieve the PR reviewer. To achieve this (i know in github) a webrequest could be sent to get this information via Rest API.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
so in general it works, but a small thing I do not want the Automation to take the Person from the Assignee field but from the field "Code Reviewer":
Our field is written this way:
In the Automation I wrote it like this:
Do I need to name it Code Reviewer.accountID ?
Or why would it not put the Code Reviewer in the comment? (The field is filled out, I just used an empty example picture here)
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Vanessa
As Stefan mentioned, the "Code reviewer" feature does not exist natively in Jira. So I assumed the next best thing is assignee.
Since you created a custom field, yes, you can use it instead of "assignee". I don't think you can use "Code Reviewer.accountID", but you can get the id for the custom field: "Hi [~accountId:{{customfield_XXXX.accountId}}]", where XXXXX is the custom field id.
You can find the id by following this guide https://confluence.atlassian.com/jirakb/how-to-find-id-for-custom-field-s-744522503.html
Cheers,
Patrik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.