Forums

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

Copy {{pullrequest.url}} from triggerIssue to linked issue Custom Field

Shushan Kocharyan January 24, 2023

Hi, 

I'm trying to copy {{pullrequest.url}} from triggerIssue to it's linked issue custom field and it doesn't work as of now. Can you advice how to do that?

I've found information that this smart value can only be used with Pull request created trigger, but was unsuccessful to use with it , because linked issue can be created any time (even before PR is created) and I need PR link to be copied. 

Please advice how can I get to that and thank you!

2 answers

1 vote
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 26, 2023

Hi @Shushan Kocharyan 

Unfortunately this isn't possible using the issue smart value like your rule is using. This is because the issue fields do not contain the full pull request information, hence why the `pullrequest` smart value is only available to the relevant triggers.

You can see the full data the issue fields has access to by hitting <your_domain>/rest/api/3/issue/<issue_key>, where you can see that the pull request custom field only contains meta data about the pr, and not details such as the url

Cheers
Sam

Shushan Kocharyan January 27, 2023

thanks for answer Sam. No way to get PR url? May I do that using scriptrunner or it'll not work as well?

Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 29, 2023

I am personally not too familiar with Scriptrunner's capabilities, but I believe it should be doable. There is rest API endpoints to fetch the PR data from Jira which you can access with Scriptrunner 

See https://community.atlassian.com/t5/Jira-questions/JIRA-REST-API-to-get-list-of-branches-related-to-a-issue/qaq-p/800389

Hopefully you can use that to solve your problem!

Cheers
Sam

0 votes
Shushan Kocharyan January 24, 2023

sample.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events