Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA 6.4 Cannot find matching method com.atlassian.jira.issue.MutableIssue#setProjectID ScriptRunner

Hi,

I'm trying to PoC some functionality in a JIRA  6.4 instance where we use Script Runner clone an issue to a user selected project and link to the original issue. I have done this before but in a later version.

For clarity this question is solely in relation to 6.4.11 and "upgrade" isn't a useful answer.

I've done my research and found similar issues (including on the Community answer I lifted the code from) but no solutions thus far. As far as I can work out SR can't get the method from Mutable Issue but it certainly should be there according to the docs.

I'm not really any kind of programmer/scripter/coder whatever so I'm quite happy for someone to point out that I've done something very basic wrong.

 

Here's the code:

import com.atlassian.jira.issue.MutableIssue;
def cfObj = customFieldManager.getCustomFieldObject('customfield_10102')
def cfValue = issue.getCustomFieldValue(cfObj)
if (cfValue != null){
    issue.setProjectId(cfValue.id)
}

Here's the error:

SR method error.png

"Cannot find matching method com.atlassian.jira.issue.MutableIssue#setProjectID"

 

Any ideas

1 answer

You are getting those static type checking errors, but have you tried to ignore those errors and just proceed with running the script anyway? The static type checker isn't always an indication that the script will not work. 

I have tried this (after prompting from your support, thanks) however it's still not working and I'm failing to get useful logging out of the interface. At this time I do not have access to the application logs. I've found another solution which I'll detail below.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

78 views 1 6
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