scriptrunner post function conditions not working in jira 7.1.9

Kate McAnespie September 7, 2016

We upgraded from 6.4.5 to 7.1.9 and most of my script runner post functions are not working properly.

I have fixed the errors for the conditions per new APIs, and the scripts all say they run successful, but they do not. There are no error logs. 

Example: Create Sub-task

Condition: issue.getComponents() == "DevEx"

Target Issue Type = Sub-Task

Subtask Summary = Create XYZ thing

 

There are no errors found. No failures in execution. And there is also NO sub-task created either.

This is not the only place where the ScriptRunner seems to be messing up post upgrade.

2 answers

1 vote
Jonny Carter
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.
September 7, 2016

Are you sure you've updated your scripts? getComponents returns a Collection<ProjectComponent>, not a string, so that test for equality will always return false, which might explain why it says it is running successfully, but not actually executing the script.

JamieA
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.
September 8, 2016

Also that never returned a string, that could never have worked, it would always have returned false. You want:

"DevEx" in issue.components*.name

 

 

Kate McAnespie September 8, 2016

That method for component was not working after upgrading to 7. That's what it used to be for the condition. I finally figured it out late yesterday after much trial and error.

Fix version condition seems to need an update too, since it is also not being interpreted correctly after upgrade, where whatever I had in 6 worked great.

I find it a little frustrating that such common, heavily used options are not in the example list. I'm not a coder...

Kate McAnespie September 9, 2016

! doesn't seem to be supported any longer either

JamieA
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.
September 9, 2016

can you attach a screenshot?

0 votes
francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 7, 2016

Hi Kate,

We are planning to upgrade, and we are extensively using script runner, so your post is really interesting.  

What is debug logging on com onresolve spitting out ?

(Admin -> Logging & Profiling -> add class ...)

 

Francis

Suggest an answer

Log in or Sign up to answer