Inject Trello Automation variable into HTTP request

Quoc-Hung Hoang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 29, 2024

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 ?

1 answer

0 votes
Mutya A
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 4, 2024

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events