Fast Track issue on Cascade select Field value

Sven Peters March 8, 2015

Hi,

I'm trying to fast-track an issue on a cascade select list value (1st option).
I followed the example and my condition is:

cfValues['On-Hold Reason']?.get(null) == 'Carrier'

The Post-Function is placed after the Fire Event (last step).
Using JIRA 6.3.10 and Script Plugin 3.0.10

Below is the debug 

2015-03-09 11:05:55,219 http-bio-9280-exec-23 DEBUG t812916 665x52761x1 1970b6w 10.137.133.64 /secure/CommentAssignIssue.jspa [canned.jira.utils.ConditionUtils] Condition: cfValues['On-Hold Reason']?.get(null) == 'Carrier' returned: false
2015-03-09 11:05:55,219 http-bio-9280-exec-23 DEBUG t812916 665x52761x1 1970b6w 10.137.133.64 /secure/CommentAssignIssue.jspa [jira.workflow.postfunctions.FasttrackTransition] Condition wasn't true

But the field is set as "Carrier" and if I place the following into the condition 

log.debug( cfValues['On-Hold Reason']?.get(null) )

I get the below debug

2015-03-09 11:14:07,835 http-bio-9280-exec-14 DEBUG t812916 674x52965x1 1970b6w 10.137.133.64 /secure/CommentAssignIssue.jspa [onresolve.scriptrunner.runner.WithPluginCompilationCustomiser] Compilation of Script45.groovy, to node: Script45
2015-03-09 11:14:07,853 http-bio-9280-exec-14 DEBUG t812916 674x52965x1 1970b6w 10.137.133.64 /secure/CommentAssignIssue.jspa [canned.jira.utils.ConditionUtils] Carrier
2015-03-09 11:14:07,853 http-bio-9280-exec-14 DEBUG t812916 674x52965x1 1970b6w 10.137.133.64 /secure/CommentAssignIssue.jspa [canned.jira.utils.ConditionUtils] Condition: log.debug( cfValues['On-Hold Reason']?.get(null) )
2015-03-09 11:14:07,853 http-bio-9280-exec-14 DEBUG t812916 674x52965x1 1970b6w 10.137.133.64 /secure/CommentAssignIssue.jspa [canned.jira.utils.ConditionUtils] Condition did not return a boolean, coercing to false

Any idea why the (original) condition fails?

Thanks,

Sven

1 answer

2 votes
Sven Peters March 9, 2015

The Object returned by

cfValues['On-Hold Reason']?.get(null)

seems to be of Type

com.atlassian.jira.issue.customfields.option.LazyLoadedOption

So what works is

cfValues['On-Hold Reason']?.get(null).getValue().equals('Carrier')

Might be worth to correct the example coming with it....

 

 

David Willox November 8, 2016

Ok, so I know this is over a year later and I didn't even ask this question, but thanks Sven. Your answer works and just saved me a ton of time.

Thanks

Dave

 

Suggest an answer

Log in or Sign up to answer