Our team is trying to setup automation triggers for Pull Request merges into specific branches.
Some Context:
- We're using GitHub for our code repo.
- GitHub integration is setup and connected properly
For this particular Automation question We're using:
- When: "Pull request merged"
- Condition: "Advanced Compare Condition"
- Then: "Transition the issue to
The issue is in the "Advanced Compare Condition". Our condition is checking if {{pullRequest.destinationBranch}} equals develop.
- Our guess is that the smart value {{pullRequest.destinationBranch}} is not yielding a result (or not our expected result).
That should be the right syntax according to the documentation here: https://support.atlassian.com/jira-software-cloud/docs/smart-values-development/
Possible issues:
- This is not supported for GitHub integrations. However, can't find any documentation on this
- We need to use the nested syntax {{pullRequest.destinationBranch.name}} as loosely implied by the link here: https://support.atlassian.com/jira-software-cloud/docs/smart-values-development/#Smartvalues-development-branch
If anyone else out there using JIRA + GitHub + Automation rules has some advice that be greatly appreciated!
Hi Sean,
I think I see what you are trying to do here. So I tried to setup my own Jira Cloud site using the Github for Jira integration and then try to setup the same automation rule in my own environment.
In my case, I was creating a new pull request that created a new branch called develop. And from there I was then merging that pull request into the master branch. Perhaps I have this part backwards from the way you are doing it. But to getting a better insight into what is being held by that particular smart value of {{pullRequest.destinationBranch}} I decided to tweak my automation rule a bit.
Before the condition I created a new action to post a comment that just echoed the source and destination branches so I can see what values they do have, like so:
and the result I got was this comment (the issue did not transition):
As you can see the destination branch in my case always seems to be using the URL instead of the name here. Honestly, I'm not sure exactly why that is yet. The source branch accurately reflected the expected smart values here (github renamed this branch from develop to develop-2 because I had another branch by that name while testing this).
Try testing out your own automation rule with a similar method to see the smart value's contents. Perhaps this way you can then tweak the rule to look for the URL values instead.
Let me know if this helps.
Andy
@Andy Heinzer That's a fantastic idea for debugging the values! Can't thank you enough. Looks like at the very least i should be able to use a regular expression to test that the destination branch URL includes the expected branch name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just tried and I'm also getting URLs for Github.
Seems like this should be documented or fixed as it's very confusing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Andy Heinzer, do you have any update on this? I can see Kevin's response, but we're using Github (not enterprise), which should be supported, and I'm still getting the following (when I log the following to an email):
Destination
Raw Name: https://github.com/CompanyName/repo-path/tree/release/0.1.0
Raw URL:
Raw Repo: MyPerch/perch-monolith
Source
Raw Name: feature/PRCHE-195-test-jira-automation-workflow
Raw URL: https://github.com/CompanyName/repo-path/tree/feature/PRCHE-195-test-jira-automation-workflow
Raw Repo:
It seems strange that the sourceBranch works, but destination branch is so weirdly swapped around.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you happen to be using GitHub Enterprise? The automation devops triggers (including Pull request merged) can't be used with GitHub Enterprise, so if this is the case the {{pullRequest.destinationBranch.name}} won't return anything.
You can find the list of compatible tools on the Automation triggers page, here.
Hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the response @Kevin Bui . Unfortunately we are not using GitHub enterprise.
Also we have tried both:
Neither seem to be returning the expected branch name value. The only thing we have to go off of is the audit log.
The log does show automation rule is triggered property when a pull request is merged.
However, it says the compare condition was not met.
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.