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

0 votes

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 Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

321 views 0 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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot