Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,000
Community Members
 
Community Events
165
Community Groups

Scriptrunner in Automation for Jira - No such property: ruleContext for class: <script_name{

Hi,

 

I've tried to load a file containing a common class through 

def utils = new GroovyScriptEngine( '/var/atlassian/application-data/jira/scripts/com/mprv/automations/EscalationSLA' ).with { loadScriptByName( 'EscalationSLA_utils.groovy' ) }
this.metaClass.mixin utils

 

Now, this sub-script contains calls to ruleContext:

String smartValue(value) { return ruleContext.renderSmartValues(value) }

(yes, I'm lazy - don't judge...)

 

however getting the error

com/mprv/automations/EscalationSLA/EscalationSLA_IssueTransition.groovy, error: groovy.lang.MissingPropertyException: No such property: ruleContext for class: EscalationSLA_IssueTransition
groovy.lang.MissingPropertyException: No such property: ruleContext for class: EscalationSLA_IssueTransition
	at Utils.smartValue(EscalationSLA_utils.groovy:18)
	at EscalationSLA_IssueTransition.run(EscalationSLA_IssueTransition.groovy:50)

 

Seemingly, the rule context is not passed to the runtime of the second file - is this even possible?

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

336 views 2 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you