JSON-parameterized URL link in email action of automation rule

Rick Crow
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.
July 28, 2020

I need to include a JSON-parameterized URL in the body of an email action to pre-fill a web form. I can successfully create the link text and send the email but if I attempt to wrap it in an HTML link tag, the resulting URL is missing the parms.

Here's what I need the URL to be ... and if I copy/paste that in my browser, it works fine:

https://www.cognitoforms.com/BrotherhoodMutual/InitialContractTestJira?entry={"JiraIssueKey":"OT-1"}

This is what I have in the email body field in the automation rule. This generates a valid URL (as above) in the resulting email, but is not a hyperlink:

https://www.cognitoforms.com/BrotherhoodMutual/InitialContractTestJira?entry={{issue.key.asJsonObject("JiraIssueKey")}}

This is what I get if I wrap that in an HTML link tag in the body field of the automation rule:

https://www.cognitoforms.com/BrotherhoodMutual/InitialContractTestJira?entry=%7B%7B

... which is obviously a complete fail.

I've made various attempts at wrapping the whole thing ... HTML link tags and all ... in something like

{{#urlEncode}}link{{/}}

or

{{#htmlEncode}}link{{/}}

 to no avail.

I'm assuming the answer is in the appropriate syntax to both allow for the use of smart values and link encoding, but I'm clearly out of my depth at this point and I'm hoping you smart folks can point me in the right direction!

Thanks in advance.

1 answer

1 accepted

0 votes
Answer accepted
Rick Crow
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.
July 31, 2020

@Andreas Knecht@Simmo : Any chance either of you can point me in the right direction with this?

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 2, 2020

Hey @Rick Crow ,

Can I get you to tag questions with just automation? We're moving away from the old codebarrel one so these questions can get missed! Like so:

tags.png

As to your question, could I get you to include some screenshots of how you've configured your rule, including the action you're having trouble with atm?

Cheers,

Simeon.

Rick Crow
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.
August 2, 2020

@Simmo Got it.

Heres the screenshot: 80D25ABC-AA3A-4FBB-95FA-17CD253E98B3.jpeg

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 4, 2020

Hey @Rick Crow ,

Assuming that you haven't changed the email format away from HTML in the "More Options" section, the first thing I'd try doing is:

<a href="https://www.etc...entry={{issue.key.asJsonObject("JiraIssueKey")}}">name of the link here</a>

You'll need to fill in the rest of your URL, but you get the idea. Put your link in the hef and then give it a name. That'll style it as an actual HTML link and hopefully remove some issues. See how you go with that and let me know.

Cheers,

Simeon.

Rick Crow
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.
August 5, 2020

@Simmo Yes, I've tried that ... see my original post for the result ... which looks like this:

https://www.cognitoforms.com/BrotherhoodMutual/InitialContractTestJira?entry=%7B

For some reason, everything beyond the first curly brace is getting clipped.

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2020

Hmmm okay @Rick Crow . Best thing to try now is to take a step back and add the log action. Then put your smart value in there and provide a screenshot of the output. Lets check what your smart value is doing.

The other thing to try, which might seem rather whack is this:

{{issue.key.asJsonObject("JiraIssueKey").urlEncode}}

 Try that inside the <a href.... suggestion. It'll encode it to go in a URL and so will look funny but the receiving service should understand it.

Rick Crow
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.
August 7, 2020

@Simmo Bingo! We have a winner. Your last suggestion works ... thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events