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
It's the same for me, please watch/contribute here: https://jamieechlin.atlassian.net/browse/GRV-544
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.