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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,293 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot