my jira version is jira 4.4.1
i add i validator on field "Resolution" in Behaviours plugin
FormField formField = getFieldById("resolution")
FormField descField = getFieldById("comment")
if (formField.getFormValue() == "1") { //
descField.setHelpText("<script type=\"text/javascript\">var str=\"WWWW\";\
AJS.$(\"#customfield_11100\").innerText=\"BBBGG\";</script>")
}
else {
descField.setHelpText("")
}
there is compilation error:
Compilation failure: startup failed: Script1.groovy: 7: illegal string body character after dollar sign; solution: either escape a literal dollar sign "\$5" or bracket the value expression "\$5" @ line 7, column 26. descField.setHelpText("<script type=\"text/javascript\">var str=\"WWWW\";\ ^ 1 error
then i replace "$" with "\$5" or "\$5",but there is no result i want.
if i use java script other than jquery,i get the result.
FormField formField = getFieldById("resolution")
FormField descField = getFieldById("comment")
if (formField.getFormValue() == "1") { //
descField.setHelpText("<script type=\"text/javascript\">var str=\"WWWW\";\
document.getElementById(\"customfield_11100\").innerText=\"BBBGG\";</script>")
}
else {
descField.setHelpText("")
}
i am wondering if we can use jquery in groovy in SetHelpText in Behaviours Plugin?