Groovy Script Error : when associating issue with epic automatically


I am working on a groovy script (which runs as post function) that creates an issue soon after an Epic is created and also associates the created issues with the Epic. So if the scripts runs successfully I should see the created issue under "Issues in Epic" field.

I am able to create the issue as soon as epic is created, but the association fails(i.e., unable to see created issue under "Issues in Epic field").

I get below error in logs:

The script failed : javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: com.atlassian.greenhopper.manager.issuelink.EpicLinkManagerImpl.associateIssuesWithEpic() is applicable for argument types: (com.atlassian.jira.user.BridgedDirectoryUser, com.atlassian.fugue.Option$Some, java.util.HashSet) values: [USER:10200, some(SCRUM-102), [SCRUM-103]]
Possible solutions: associateIssuesWithEpic(com.atlassian.crowd.embedded.api.User, com.atlassian.fugue.Option, java.util.Set)

I am using instance of "epicLinkManagerImpl" and calling associateIssuesWithEpic() as in below code

Issue archIssue =issueManager.createIssueObject(user,issueObject)
				User user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
				def epic = (Option)Option.option(issue)
				def issueSet = new HashSet<Issue>();
				epicLinkManagerImpl.associateIssuesWithEpic(user, epic, issueSet);

I wrote above based on the information obtained here

After going through couple of forums, I felt that it might have something to do with the plugins I am using, but don't any proofs to support the same.

Looking for some help here :)



3 answers

1 accepted

1 vote
Answer accepted

Hi Jamie,

Got the script working after changing the method to "createLink" from "associateIssuesWithEpic".

Our current version of gh-plugin is 6.3.6, API doc of which shows "associateIssuesWithEpic()".

But unknowingly on trying createLink() method inplace of above made the script work!

On refering to the documentation found that this method was supported in API version 6.0.7

Not sure how it worked.


Oh cool... well done. Sounds like that will be useful others too.

yeah, it worked for me, hope it works/helps others with similar problem too...

Don't really understand why that doesn't work... if you look at what you are passing and what it expects it looks correct.

A BridgedDirectoryUser "is a" com.atlassian.crowd.embedded.api.User, so that's not a problem.

"Some" is an "Option", so same there, and clearly a HashSet is a Set.

Can you post a minimal but complete script that demonstrates the issues to, if you do that I will try to reproduce and debug.

Thanks Jamie for the help. Here is the link to the gist where I have placed the script:

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


247 views 0 6
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