// With the following code
if (it instanceof com.atlassian.crowd.model.user.User) { <-- ERROR it.firstName +" "+ it.lastName +" ("+it.name+")" } else { it }
// I am receiving the following error with the scriptrunner 3.0.6
unable to resolve class com.atlassian.crowd.model.user.User
// my imports are:
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.properties.APKeys
import com.atlassian.jira.config.properties.ApplicationProperties
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.watchers.WatcherManager
import com.atlassian.jira.security.groups.GroupManager
import com.atlassian.jira.security.roles.ProjectRole
import com.atlassian.jira.security.roles.ProjectRoleManager
import com.atlassian.jira.user.util.UserUtil
import com.atlassian.jira.user.UserUtils
import com.atlassian.mail.Email
import com.atlassian.mail.MailException
import com.atlassian.mail.MailFactory
import com.atlassian.mail.queue.SingleMailQueueItem
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.server.SMTPMailServer
import com.onresolve.scriptrunner.canned.jira.utils.ConditionUtils
import com.opensymphony.workflow.WorkflowContext
import groovy.text.GStringTemplateEngine import org.apache.log4j.Category
import org.ofbiz.core.entity.GenericValue
// QUESTION
How can I get rid of this error?
I am not able to reproduce the error in script console because
of another error before reaching the codeline with instanceof ...
No such property: transientVars for class: SendPreDeliveryMail
groovy.lang.MissingPropertyException: No such property: transientVars for class: SendPreDeliveryMail at SendPreDeliveryMail.run(SendPreDeliveryMail.groovy:370)
that's understandable, but you can test it with just that single import as the entire script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No This is not inside an email teplate. It is a post function configured in a specific state transition. This function was working perfectly with JIRA 6.1 and the old version (2.1.16) of scriptrunner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you reproduce this in the script console? Or is it specifically in post-functions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this in an email template? I don't think you can do imports with GStringTemplateEngine.
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.
what jira version?
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.