Hi,
To validate the condition of a transition I must be able to compare the name of a user entered in an issue field and the lead associated with the selected component in the same issue.
I have found two solution based on ScriptRunner :
The first to compare two field :
cfValues['Field1'] == cfValues['Field2']
The second to find the lead of the first component selected in an issue
package com.onresolve.jira.groovy.test.scriptfields.scripts
def components = issue.componentObjects.toList()
if (components) {
return components?.first()?.componentLead
}
But when i want to merge to compare the component lead and a field it doesn't work.
package com.onresolve.jira.groovy.test.scriptfields.scripts
def components = issue.componentObjects.toList()
if (components) {
return components?.first()?.componentLead
}
For example :
package com.onresolve.jira.groovy.test.scriptfields.scripts
def components = issue.componentObjects.toList()
if (components) {
return components?.first()?.componentLead == cfValues['Field1']
}
Can you help me ?
Regards