unable to resolve class com.atlassian.crowd.model.user.User with the scriptrunner 3.0.6

Aret Boduryan November 19, 2014

 

 

 

// 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?

5 answers

0 votes
Aret Boduryan November 24, 2014

  

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)

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.
November 25, 2014

that's understandable, but you can test it with just that single import as the entire script.

0 votes
Aret Boduryan November 23, 2014

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. 

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.
November 24, 2014

Can you reproduce this in the script console? Or is it specifically in post-functions?

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.
November 23, 2014

Is this in an email template? I don't think you can do imports with GStringTemplateEngine.

0 votes
Aret Boduryan November 20, 2014

JIRA version is 6.3.1

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.
November 20, 2014

what jira version?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events