You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
our customer want to use behaviours to prepopulate a hyperlink in the description field.
Please can you help with the code?
def desc = getFieldById("description");
def text = "hier";
def hyper=text.link("http://google.com");
def defaultValue ="""Instruktionen sind """+ hyper+""" zu finden""";
if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
I get an error on line 3: "Cannot find matching method" and no output
Hello @Ireen Klein_Actonic
You should do it via html tags, like this
def desc = getFieldById("description");
def hyper="<a href=\"http://google.com\">google</a>";
def defaultValue ="""Instruktionen sind """+ hyper+""" zu finden""";
if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
Hello @Mark Markov,
thx for your answer. Unfortunately it doesn't work.
The output/the prepopulated text in description field is:
Instruktionen sind <a href="http://google.com">google</a> zu finden.
What have I to change?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, its description.
Try this
def desc = getFieldById("description");
def hyper="[google|http://google.com]";
def defaultValue ="""Instruktionen sind """+ hyper+""" zu finden""";
if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
And make sure that wiki render is enabled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mark Markov
Do you know if there is an alternative way? as we are not allowed to enable wiki render because of a security risk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ChristopherChilds you can use the field description to have the URL added in field's description IMO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.