simple scripted conditions on workflow transition - error on preview and always evaluate true

Sam Hasler February 10, 2017

I have a [Edit: workflow transition with a] simple scripted condition in which I have placed the single word "false", yet it behaves as if it evaluated to true.

When previewing it I see this error:

Cannot cast object 'haslers(haslers)' with class 'com.atlassian.jira.user.DelegatingApplicationUser' to class 'com.atlassian.crowd.embedded.api.User'


JIRA version: v7.1.4#71008-sha1:eaa0661

 

[EDIT]: 

This is on server, not cloud, so I wonder if the com.atlassian.crowd.embedded.api.User is incorrectly referencing code in the cloud codebase (because of crowd) instead of the server codebase.


Here's a screenshot of how I've configured the script.

image2017-2-14 9:8:46.png

 

[EDIT2] 

We're on version 3.0.10 and there's no budget for getting the paid version so I guess I'll have to look at an alternative way to do this that doesn't involve script runner. (would have replied in a comment but I don't have enough points)


9 answers

0 votes
Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 15, 2017

Hi Sam, 

So yes the problem is that the 3.0.10 version is not compatible with the JIRA v7 

Changes in the JIRA API, like the one you face, made it hard to make at least one free version compatible with JIRA v7.

regards, Thanos

0 votes
Sam Hasler February 15, 2017

@Thanos Batagiannis [Adaptavist], I'm on version 3.0.10

0 votes
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 14, 2017

Indeed Thanos, I am aware that return is optional, but I wanted to make sure that a boolean is returned as a single false might have been interpreted as a string, as I not aware of the exact behind the scene semantics of the code that kicks in when the validation is executed.

http://stackoverflow.com/questions/8930325/groovy-truth-string-to-boolean-inconsistency

 

0 votes
Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 14, 2017

Tarun, in groovy, return is optional, so probably this is not the issue. I think the issue is with the ScriptRunner version  Sam uses. 

0 votes
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 14, 2017

Did you try "return false;" instead of just false.

0 votes
Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2017

Hi Sam, 

Which version of ScriptRunner you use ?

0 votes
Sam Hasler February 13, 2017

I should have said, this is a condition on a workflow transition.

0 votes
Sam Hasler February 13, 2017

@Thanos Batagiannis [Adaptavist], My script is literally "false" (see attachment). So it should always fail, and yet it doesn't. This makes me think it's a bug in JIRA, unless I'm completely misunderstanding how simple scripted conditions work.

0 votes
Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2017

Suggest an answer

Log in or Sign up to answer