Behaviours doesn´t work after upgrade

Benjamin Mahler July 4, 2016

Hi,

we upgraded to JIRA 7 from v6.4.11 to v7.1.4 and ScriptRunner form v4.1.3.15 to v4.3.4. Since then some of the behaviour scripts (triggered at ticket creation) doesn´t work anymore. If I remove the following script evertything works as it should. But we need this script.

I have activated the logging but there are no errors in the log.The script validation say: unable to resolve class FormField. I have tried to switch from FormField to def - it does not work.

image2016-7-4 15:45:53.png


Any idea how to solve this issue?


Kind regards, Benjamin


FormField FieldKategorie11507 = getFieldById ("customfield_11507")  
FieldKategorie11507.setHelpText("<script type=\"text/javascript\">FieldKategorie11507_Value=document.getElementById(\'customfield_11507\');\

  FieldTechnPL_1=document.getElementById(\'customfield_12002\').parentNode;\

  FieldTechnPL_2=document.getElementById(\'customfield_12002\');\

  FieldFachlPL_1=document.getElementById(\'customfield_12003\').parentNode;\

  FieldFachlPL_2=document.getElementById(\'customfield_12003\');\

  FieldLinkKPLaufwerk_1=document.getElementById(\'customfield_12004\').parentNode;\

  FieldLinkKPLaufwerk_2=document.getElementById(\'customfield_12004\');\

  FieldLinkAlfi_1=document.getElementById(\'customfield_11401\').parentNode;\

  FieldLinkAlfi_2=document.getElementById(\'customfield_11401\');\

  switch(FieldKategorie11507_Value.value){case\'11222\':\

  var value=\"gginf22\";\

  AJS.\$(\"#assignee-field\").val(value);\

  AJS.\$(\"#assignee\").find(\":selected\").data(\"descriptor\").model()[0].value=value;\

  AJS.\$(\"#customfield_12002\").closest(\'div.field-group\').hide();\

  FieldTechnPL_2.value=\"\";\

  AJS.\$(\"#customfield_12003\").closest(\'div.field-group\').hide();\

  FieldFachlPL_2.value=\"\";\

  FieldLinkKPLaufwerk_1.style.display=\'none\';\

  FieldLinkKPLaufwerk_2.value=\"\";\

  FieldLinkAlfi_1.style.display=\'none\';\

  FieldLinkAlfi_2.value = \"\";\

  break;\

  case\'11223\':\

  var value=\"gginf22\";\

  AJS.\$(\"#assignee-field\").val(value);\

  AJS.\$(\"#assignee\").find(\":selected\").data(\"descriptor\").model()[0].value=value;\

  AJS.\$(\"#customfield_12002\").closest(\'div.field-group\').hide();\

  FieldTechnPL_2.value=\"\";\

  AJS.\$(\"#customfield_12003\").closest(\'div.field-group\').hide();\

  FieldFachlPL_2.value=\"\";\

  FieldLinkKPLaufwerk_1.style.display=\'none\';\

  FieldLinkKPLaufwerk_2.value=\"\";\

  FieldLinkAlfi_1.style.display=\'none\';\

  FieldLinkAlfi_2.value = \"\";\

  break;\

  case\'11226\':\

  var value=\"rmb10004526\";\

  AJS.\$(\"#assignee-field\").val(value);\

  AJS.\$(\"#assignee\").find(\":selected\").data(\"descriptor\").model()[0].value=value;\

  AJS.\$(\"#customfield_12002\").closest(\'div.field-group\').show();\

  AJS.\$(\"#customfield_12003\").closest(\'div.field-group\').show();\

  FieldLinkKPLaufwerk_1.style.display=\'\';\

  FieldLinkAlfi_1.style.display=\'\';\

  break;\

  default:\

  var value=\"-1\";\

  AJS.\$(\"#assignee-field\").val(value);\

  AJS.\$(\"#assignee\").find(\":selected\").data(\"descriptor\").model()[0].value=value;\

  AJS.\$(\"#customfield_12002\").closest(\'div.field-group\').hide();\

  FieldTechnPL_2.value=\"\";\

  AJS.\$(\"#customfield_12003\").closest(\'div.field-group\').hide();\

  FieldFachlPL_2.value=\"\";\

  FieldLinkKPLaufwerk_1.style.display=\'none\';\

  FieldLinkKPLaufwerk_2.value=\"\";\

  FieldLinkAlfi_1.style.display=\'none\';\

  FieldLinkAlfi_2.value=\"\";\

  break;}</script>")

3 answers

0 votes
Benjamin Mahler July 5, 2016

Hi @Jamie Echlin [Adaptavist],

how do I solve this issue?

Regards, Benjamin

 

0 votes
Benjamin Mahler July 4, 2016

Hi Jamie,

the script validation is ok now tick

But i am still not able to create tickets. I stuck at the creation screen. Clicking the create button does nothing and I can see timeouts in the logs. If I remove this script everything works. Other scripts are working at the same time, though.

Regards, Benjamin

 

JamieA
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 5, 2016

it's easier if you would comment on answers rather than creating new answers.

Please could you check your javascript logs by pressing f12? It might be easier to give them to us privately which, you can do by raising a ticket at https://productsupport.adaptavist.com/servicedesk/customer/portal/2

 

0 votes
JamieA
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 4, 2016

can you try with the import:

import com.onresolve.jira.groovy.user.FormField

Suggest an answer

Log in or Sign up to answer