Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem creating subtask within a script

Andreas Sumper
January 12, 2016

Hi all!

 

I also posted this on stackoverflow, but did not get any answer. Hopefully someone here can help me with my problem. I had this script running, but tried to remove deprecated functions. I removed almost all of them, but I am stuck on this code.

 

I am working on some groovy-scripts in jira. The script get´s triggered as a postfunction using the scriptrunner plugin. The code, that produces the error is this one:

ComponentAccessor CompAcc = new ComponentAccessor() 
SubTaskManager subTaskManager = CompAcc.getSubTaskManager() 
... 
def subTask = issueManager.createIssue(CompAcc.getJiraAuthenticationContext().getLoggedInUser(), issueObject) 
subTaskManager.createSubTaskIssueLink(issue, subTask, usera)

where issue is the issue, on which the postfunction was triggered. The subtask get´s created but not linked to the calling task.

And this is the error:

2016-01-11 11:39:39,925 http-bio-8063-exec-19 ERROR asu 699x3972x1 16m4yz4 10.1.21.129 /secure/CommentAssignIssue.jspa [scriptrunner.jira.workflow.ScriptWorkflowFunction] ************************************************************************************* 
2016-01-11 11:39:39,926 http-bio-8063-exec-19 ERROR asu 699x3972x1 16m4yz4 10.1.21.129 /secure/CommentAssignIssue.jspa [scriptrunner.jira.workflow.ScriptWorkflowFunction] Script function failed on issue: RQA-7338, actionId: 81, file: /home/qa/Tools/Jira/scripts/CreateDevTestExecutionSubtask.groovy groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.config.DefaultSubTaskManager.createSubTaskIssueLink() is applicable for argument types: (com.atlassian.jira.issue.IssueImpl, com.atlassian.jira.ofbiz.IssueGenericValue, com.atlassian.jira.user.DelegatingApplicationUser) values: [RQA-7338, [timespent:null, timeoriginalestimate:7200, project:11400, ...], ...] Possible solutions: createSubTaskIssueLink(com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User), createSubTaskIssueLink(org.ofbiz.core.entity.GenericValue, org.ofbiz.core.entity.GenericValue, com.atlassian.crowd.embedded.api.User) at CreateDevTestExecutionSubtask.run(CreateDevTestExecutionSubtask.groovy:212)

 

So what I need to know, is how I can convert com.atlassian.jira.issue.IssueImpl andcom.atlassian.jira.ofbiz.IssueGenericValue to com.atlassian.jira.issue.Issue so that the linking of the subtask works again. Or someone can help me to explain, how I have to use the missing function.

Thanks for any help!

4 answers

1 vote
Begoña Bonet
Contributor
July 24, 2015
0 votes
Begoña Bonet
Contributor
July 26, 2015

Yes, I think so. Not this year but in the next 2 years could be

0 votes
Nic Brough -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 Champions.
July 24, 2015

Interesting, I've not run into that before.   It looks like the issue has been fixed though.  Do you think you'll get to 1,000 projects?

0 votes
Nic Brough -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 Champions.
July 24, 2015

You'll never reach the technical limit before your admins tell you "we can't cope with the number of projects". 

I'm curious as to where you read this.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events