ScriptRunner - Fast track logic failing in JIRA upgrade to 6.4.7, Scriptrunner 3.0.16

Susan Hauth _Jira Queen_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 2, 2015

Upgraded from JIRA 6.1.3 to 6.4.7 and Scriptrunner 2.1.16 to 3.0.16 in our DEV.   The fast-track condition is failing and give us an error in the log:

2015-07-02 18:03:20,363 http-bio-443-exec-1 ERROR shauth 1083x1212x3 162b5os 10.9.30.109 /secure/CreateIssueDetails.jspa [canned.jira.utils.ConditionUtils] Script follows:

cfValues['Quick Close']*.value.contains("Quick Close") && isUserMemberOfRole('Operations')

No other changes made. 

6 answers

1 accepted

0 votes
Answer accepted
Susan Hauth _Jira Queen_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 6, 2015

Problem Solved!  the Project Role was "Operations  " (2 blanks on the end). Argh.  I edited the role name and voila all is fine again.   Guess 6.1 wasn't as fussy!  MANY THANKS!!!

 

0 votes
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.
July 5, 2015

I just tested this on JIRA 6.4.1 and it worked fine... can you paste the following code in to the script console and run it:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager


def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)
projectRoleManager.getProjectRole("Operations") ?: "Can't find role"

It should return the name of the role.

0 votes
Susan Hauth _Jira Queen_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 2, 2015

Yes "Operations" is still valid. One of our mainstay well used roles and I just double checked in case the upgrade did anything to it, but looks the same.

0 votes
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.
July 2, 2015

looks like it can't find that role - is it still valid?

0 votes
Susan Hauth _Jira Queen_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 2, 2015

2015-07-02 18:03:18,860 http-bio-443-exec-1 WARN shauth 1083x1212x3 162b5os 10.9.30.109 /secure/CreateIssueDetails.jspa [onresolve.scriptrunner.runner.ScriptRunnerImpl] Add a script root for this path: D:\Program Files\Atlassian\JIRA\atlassian-jira\WEB-INF\lib\CalculateDueDate.groovy

2015-07-02 18:03:19,691 http-bio-443-exec-1 ERROR shauth 1083x1212x3 162b5os 10.9.30.109 /secure/CreateIssueDetails.jspa [CRM-PLUGIN] Could not find the custom field 'Contact'

2015-07-02 18:03:19,695 http-bio-443-exec-1 ERROR shauth 1083x1212x3 162b5os 10.9.30.109 /secure/CreateIssueDetails.jspa [CRM-PLUGIN] Could not find the custom field 'Case'

2015-07-02 18:03:19,982 http-bio-443-exec-1 ERROR shauth 1083x1212x3 162b5os 10.9.30.109 /secure/CreateIssueDetails.jspa [CRM-PLUGIN] Could not find the custom field 'Contact'

2015-07-02 18:03:19,982 http-bio-443-exec-1 ERROR shauth 1083x1212x3 162b5os 10.9.30.109 /secure/CreateIssueDetails.jspa [CRM-PLUGIN] Could not find the custom field 'Case'

2015-07-02 18:03:20,361 http-bio-443-exec-1 ERROR shauth 1083x1212x3 162b5os 10.9.30.109 /secure/CreateIssueDetails.jspa [canned.jira.utils.ConditionUtils] *************************************************************************************

2015-07-02 18:03:20,362 http-bio-443-exec-1 ERROR shauth 1083x1212x3 162b5os 10.9.30.109 /secure/CreateIssueDetails.jspa [canned.jira.utils.ConditionUtils] Condition failed on issue: HELP-49989, built-in script:com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition

java.lang.IllegalArgumentException: ProjectRole can not be null

    at com.atlassian.jira.security.roles.DefaultProjectRoleManager.getProjectRoleActors(DefaultProjectRoleManager.java:127)

    at com.atlassian.jira.security.roles.ProjectRoleManager$getProjectRoleActors$0.call(Unknown Source)

    at com.onresolve.scriptrunner.canned.jira.utils.ConditionUtils$_setupBinding_closure1.doCall(ConditionUtils.groovy:154)

    at Script4.run(Script4.groovy:1)

0 votes
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.
July 2, 2015

The previous line should be an exception - can you post that as well?

Suggest an answer

Log in or Sign up to answer