You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello,
we migrated from JIRA 7 to 8.5.
Now I have errors with a behavior that work great before migration.
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.component.pico.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.MutableIssue
ComponentManager componentManager = ComponentManager.getInstance()
Object fieldID = getFieldById("Application")
MutableIssue currentIssue = componentManager.getIssueManager().getIssueObject(Long.parseLong(fieldID.value))
FormField pr_field = getFieldById("Application")
def isPR = componentManager.getUserUtil().getGroupNamesForUser(currentIssue.getReporter
User().getDisplayName()).contains("Groupe-P2B-Application_2")
if(!isPR){
pr_field.setHidden(false)
pr_field.setRequired(true)
}
help please ?
Thanks,
BR
Fayçal
And what exactly is the error?
Also what version of scriptrunner did you upgrade from and to?
Hello,
this a screen shot of this error :
ScriptRunner from V 5.6.12 to V 6.16.0.
Thanks for your help.
BR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try adding the explicit import?
import com.onresolve.jira.groovy.user.FormField
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i put this code in the behaviour :
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.component.pico.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.MutableIssue
import com.onresolve.jira.groovy.user.FormFieldComponentManager
componentManager = ComponentManager.getInstance()
Object fieldID = getFieldById("Application")
MutableIssue currentIssue = componentManager.getIssueManager().getIssueObject(Long.parseLong(fieldID.value))
FormField pr_field = getFieldById("Application")
def isPR = componentManager.getUserUtil().getGroupNamesForUser(currentIssue.getReporterUser().getDisplayName()).contains("Groupe-P2B-Application_2")
if(!isPR){
pr_field.setHidden(false)
pr_field.setRequired(true)
}
now i have this error :
please help ?
Thanks,
Fayçal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well you didn't import the correct class..
import com.onresolve.jira.groovy.user.FormFieldComponentManager
is not
import com.onresolve.jira.groovy.user.FormField
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I m sorry for the mistake :
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.component.pico.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.MutableIssue
import com.onresolve.jira.groovy.user.FormField
ComponentManager componentManager = ComponentManager.getInstance()
Object fieldID = getFieldById("Application")
MutableIssue currentIssue = componentManager.getIssueManager().getIssueObject(Long.parseLong(fieldID.value))
FormField pr_field = getFieldById("Application")
def isPR = componentManager.getUserUtil().getGroupNamesForUser(currentIssue.getReporterUser().getDisplayName()).contains("Groupe-P2B-Application_2")
if(!isPR){
pr_field.setHidden(false)
pr_field.setRequired(true)
}
i have also this error :
Thanks for your help
Fayçal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well I don't see anything wrong with that line of code.
I also don't find anything in the release notes that might be causing this for v6.x
Might be best to simply raise a call with Adaptavist for this to see if anything in the classes has changed that wasn't mentioned in the release notes.
Or hope for someone else to take a look and see whats wrong..
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.
Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.