We run a single project for all new feature work, defects, and improvements for our product. There are somewhere in the vicinity of 30 repositories that make up our product, which is likely to grow over the coming months.
We are looking for a way to automatically add a label, component, or otherwise set some other field value to match the repository (or repositories) name when a pull request has been merged.
I've had a look at the OOTB Jira Automation possibilities and not really seeing much there that would be able to get the repo name from our connected Bitbucket then set that value on an issue. It seems I can detect when a PR was merged, which is fantastic (I'll use this for other things) and gets me part of the way there.
Any help would be great.
TLDR; Trying to get repository name from bitbucket after pull request merged, to the set this as a value in a Jira issue.
Using jira automation you can achieve what you are looking for. Please take a look into this link:
https://support.atlassian.com/jira-software-cloud/docs/smart-values-development/
Cool! I'll look into how to leverage these smart values, but seems to be a step in the right direction.
Any idea what would happen if a ticket had multiple pull requests across multiple repos? ie would I still be able to use, say, this smart value:
{{pullRequest.sourceBranch.repository}}
Would I get an array of values plugged into the field I want, or just the first one found?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried the following rules in Automation, but have not had any luck in getting the label field to be set:
1.
WHEN: Pull request merged
THEN: Edit issue fields LABEL {{branch.repository}} (also tried {{pullRequest.sourceBranch.url}})
2.
WHEN: Issue transitioned from In Progress to Deployed to Dev
THEN: Edit issue fields LABEL {{branch.repository}} (also tried {{pullRequest.sourceBranch.url}})
I have set up email alerts to tell me if the rule fails, but I have received no alert and no Label fiel set. Without some sort of feedback on why this works, it just seems like this feature simply doesn't work. @Jira Guru is there somewhere I can poke around to find out why this rule seems to not have run? Or am I using smart values incorrectly, perhaps against a field that doesn't support it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Darren Marshall You should be able to test an automation rule using a few different techniques.
It's a bit to type out, so I've just shot a quick video for you: https://www.loom.com/share/2987c5e4879f481996b074126b49d19e
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Wes! Some good tips in there I'll put to use today and see if I can work out my situation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.