Unable to resolve custom class - Scriptrunner 3.0.6

Hi

Im trying to migrate scripts from a previous version into 3.0.6 and having some difficulties.

I have a class on the server which I have moved into the script root in a folder called util.

 

package util

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.link.IssueLink

class CRTransitionConditionStatus {
    public boolean result = true
    public ArrayList failedFields = []
    public ArrayList subTaskCompleteStatus = ['10030', '10034']
    public boolean checkConditionByStatus(Issue issue) {
     return false
    }
    public boolean checkConditionByWorkflowID(Issue issue, int workflowID) {
        try {
           
        } catch(all) {
            
        }  finally {
            return false
        }
    }
}

I am then trying to use this class within a workflow condition by using the following

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import groovy.sql.Sql
import org.apache.log4j.Category
import com.opensymphony.workflow.loader.WorkflowDescriptor
import groovy.xml.MarkupBuilder
import util.CRTransitionConditionStatus


def t = new CRTransitionConditionStatus()
boolean result = false
log = Category.getInstance("com.onresolve.jira.groovy.CRTransitionConditionStatusWorkflow")
try{
    ComponentManager componentManager = ComponentManager.getInstance()
   // Issue issue = componentManager.getIssueManager().getIssueObject("CR-283")        //for testing
    WorkflowDescriptor wd = transientVars['descriptor']
    wd.getAction(transientVars['actionId']).getName()
    t.checkConditionByWorkflowID(issue,transientVars['actionId'])
    result = t.result
} catch (all) {
    log.error("Unable to validate workflow on " + issue.key)
} finally {
     return result
}

I am receiving an error message of Unable to resolve class CRTransitionConditionStatus. I have tried adding the above script into the Script Root folder and pointing the condition to this script and it runs with no error however it always resolves to TRUE even when i specifically return FALSE.

What am i doing wrong? I have managed to port across all other scripts and JQL functions.

Regards

2 answers

0 vote
Henning Tietgens Community Champion Oct 26, 2014

It's the same for me, please watch/contribute here: https://jamieechlin.atlassian.net/browse/GRV-544

Thanks Henning - I will follow that issue from now.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

136 views 0 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you