Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Automation - Smart Values - GitHub Pull request merged

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!

2 answers

1 accepted

1 vote
Answer accepted
Andy Heinzer Atlassian Team Mar 24, 2021

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:

Screen Shot 2021-03-24 at 1.13.09 PM.png

and the result I got was this comment (the issue did not transition):

Screen Shot 2021-03-24 at 1.13.31 PM.png

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.

Like Andy Heinzer likes this
0 votes
Kevin Bui Atlassian Team Mar 24, 2021

Hi @Sean Briceland

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!

Thanks for the response @Kevin Bui . Unfortunately we are not using GitHub enterprise. 

Also we have tried both:

  • {{pullRequest.destinationBranch}}
  • {{pullRequest.destinationBranch.name}}

 

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

20 views 1 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you