using smartvalues in URL field

HC M April 12, 2024

Hi,

I'm having issues with using smartvalues in a field which is an URL type field.

i.e.:

I'm trying to fill an URL field with an URL that's created with information from the issue (let's say summary). So the URL I'm trying to write to the field looks like this:

https://test.com/{{issue.summary}}

An URL field does not accept values with curly brackets. Is there an elegant solution to this problem?

Thank you!

1 answer

1 accepted

1 vote
Answer accepted
Kalyan Sattaluri
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.
April 12, 2024

Hello @HC M 

What do you mean URL does not accept curly braces?

Is this an automation rule? Please share some screenshots.

HC M April 12, 2024

sorry I meant curly brackets: {}

When you try and write an URL in an URL type field, you will get an error that the string is not valid.

In my automation I'm simply setting a field value ("Edit issue fields"):

{
"fields": {
"myfieldname": "https://test.com/{{issue.summary}}"
}
}

Kalyan Sattaluri
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.
April 12, 2024

Hello @HC M 

Hmm. Your syntax is good as its shown.

Where are you seeing this error that the string is not valid? In the audit log after rule is run or even at the point of saving the rule?

Can you log this value  https://test.com/{{issue.summary}}

Can you, instead of advanced edit using JSON, directly assign your field this value by choosing the field from dropdown and assigning this string to it?

HC M April 12, 2024

Hi @Kalyan Sattaluri 

thanks for your support, I found that the issuesummary that I used for testing had some umlauts (ü,ä) in it which made in incompatible with the URL field.

Which means the curly brackets/smart value was not issue.

What helped was the possibilty to encode to an URL via smart values/function:

{{issue.summary.urlEncode}}

Like # people like this

Suggest an answer

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

Atlassian Community Events