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

Inject Trello Automation variable into HTTP payload

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!
June 3, 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

2 votes
milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 3, 2024

@Quoc-Hung Hoang 
I will not speak to the specific of your payload. It should not have all \n or / etc just text. 

Dreamsuite Mike
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 4, 2024

@milynnus is correct about not needing the \n

 

It should have the format:

{"name1":"value1","name2":"value2"}

or

{"name1": {"nestedname1" :"nestedvalue1"},"name2": {"nestedname2" :"nestedvalue2"}}

Regarding variables, they do seem to be hit and miss.

If you find {cardname}, {cardnumber} dont work, try {triggercardname}, {triggercardnumber}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events