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

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

Graham Horsman September 28, 2017

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

Suggest an answer

Log in or Sign up to answer
0 votes
Joshua Yamdogo @ Adaptavist
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 29, 2017

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. 

Graham Horsman October 2, 2017

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.

TAGS
AUG Leaders

Atlassian Community Events