Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

After creating PR, post URL into comment Automation

Vanessa
Contributor
September 13, 2022

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.

Bildschirmfoto 2022-09-13 um 15.48.31.png

 

Maybe someone has a easy solution for this :) 

Thank you already in advance!
-Vanessa

1 answer

0 votes
Patrik Korovsky
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 13, 2022

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}}!

PR.png

You can read more about development smart values here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/

Stefan Salzl
Community Champion
September 13, 2022

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

Vanessa
Contributor
September 14, 2022

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":

Bildschirmfoto 2022-09-14 um 13.09.47.png

Our field is written this way:

Bildschirmfoto 2022-09-14 um 13.09.53.png

In the Automation I wrote it like this:

Bildschirmfoto 2022-09-14 um 13.10.21.png

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!

Patrik Korovsky
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2022

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.

 

customfield.png

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

Like Stefan Salzl likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events