I want to leverage Trello Automation to create a pull request on my Bitbucket repo via Bitbucket Rest API.
Given a Trello card which has a number and a name. In Automation, we have corresponding variables: {cardnumber} and {cardname}
I created a rule like this:
post to url:
https://api.bitbucket.org/2.0/repositories/plb-alana/alana/pullrequests
payload (represented as JSON object):
{\n "title": {cardname},\n "source": {\n "branch": {\n "name": "feature/"{cardnumber}"/"{cardname}\n }\n },\n "destination": {\n "branch": {\n "name": "staging"\n }\n }\n}
But looks like the Automation didn't substitute my variables into actual values.
Can I confirm automation variables are working in such use case ?
Hi there!
Could you send me the payload again as the one in your query does not seem to be formatted correctly, especially on this part:
"name": "feature/"{cardnumber}"/"{cardname}
Just to let you know that variables used in the payload are automatically escaped to be part of a valid JSON string. I would recommend to try using one variable for now and shorten your JSON object to check if it works.
For more information: https://support.atlassian.com/trello/docs/issuing-http-requests/
I hope this helps, but let us know if you have any questions!
----------------
If this post helps with your query, then please consider the Accept answer or Like button to help the other users find it more quickly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.