Fast Track issue on Cascade select Field value

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

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....

 

 

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
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
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

372 views 4 10
Read article

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