We are currently running on Jira Datacentre 8.20.12 and recently we have upgraded the script runner to
Adaptavist ScriptRunner for Jira old version 6.58.0 to new version 7.1.0
the issue is identified and we have closed the the bug.
Considering you are running this in a Behaviour I would omit the 2 imports.
And for bsValue you indeed did not declare it. Just put a def in front of it to catch all types and should be good to go
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Dirk the minor issues are solved now we are facing major issue with the groovy scripts
we have the code for Auto Updates on Field Change when we try to create an issue, for example if select the application the corresponding Team should get populated but now its not getting populated inspite of getting all the functions and the script is running too successfully
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is the sample code
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
FormField bs = getFieldByName("Business Services")
FormField bgroup = getFieldByName("Business Services Groups")
def bgroups = []
List bservices = []
def bsValue = null
// getValue will sometimes fail with a NumberFormatException when using it with the multi-select frother
try {
bsValue = bs.getValue()
}catch(NumberFormatException n){
return // DON'T carry on
}
if(bsValue instanceof String) {
bservices.add(bsValue)
//log.debug(bsValue))
} else {
bservices = bsValue as List
}
// return and carry on
for (bservice in bservices){
// Business Services Group1
switch (bservice){
// Business team 1
case [
'Business case 1'
]:
bgroups.add(12683)
break
}
switch (bservice){
// Business Services Group2
case [
'Business cteam 1'
]:
bgroups.add(13533)
break
}
}
bgroup.setFormValue(bgroups)
def exit=0
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.