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,359,863
Community Members
 
Community Events
168
Community Groups

Scriptrunner Script field error

Discovered error with a custom scripted field, most likely after having upgraded to JIRA 7.8.0.  It looks like ComponentManager has been replaced with ComponentAccessor.

This was my script:

import com.atlassian.jira.ComponentManager;

def burl = ComponentManager.getInstance().getApplicationProperties().getString("jira.baseurl")

return (issue.parent != null) ? "<a href=\""+ burl + "/browse/"+ issue.parentObject.key + "\">"+ issue.parentObject.key + "</a>" : "";

 

I changed it to:

import com.atlassian.jira.component.ComponentAccessor;

def burl = ComponentAccessor.getInstance().getApplicationProperties().getString("jira.baseurl")

return (issue.parent != null) ? "<a href=\""+ burl + "/browse/"+ issue.parentObject.key + "\">"+ issue.parentObject.key + "</a>" : "";

 

But getting "cannot find matching method" error.

What am I doing wrong?  Thanks!

 

1 answer

1 accepted

0 votes
Answer accepted
Payne Rising Star Oct 08, 2018

getInstance() is not needed. Try this:

ComponentAccessor.getApplicationProperties().getString("jira.baseurl")

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

172 views 1 6
Read article

Atlassian Community Events