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
@Mark Markov : If we wanted to have 2 hyperlinks in description(Google and yahoo.com) field does it work ? if so could you please help on that ?
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)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.