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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

919 views 3 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you