How do I create a EpicLinkManagerImpl instance?

Follow up from a previous post. I have been trying to add a newly created Task to an existing Epic.

I know that I can find the Epic key # and the Epic name in the custom fields of the epic story and the epic itself but I need to use EpicLinkManagerImpl.associateIssuesWithEpic to link the newly created Task to the existing Epic.

Just writing the Epic key to the Epic Link of the new created Task does not seem to be enough for the Greenhopper functionality.

I cannot use @ComponentImport EpicLinkManagerImpl in my constructor as then my class won't be loaded.

I tried using ComponentAccessor.getComponentOfType(EpicLinkManagerImpl.class) but it can't get that class, it returns null.

I tried just a myclass= new EpicLinkManagerImpl(); 

That last one seems to work but after passing it a correct issue I get a crash in the EpicLinkManagerImpl class:

[INFO] [talledLocalContainer] java.lang.NullPointerException
[INFO] [talledLocalContainer] at com.atlassian.greenhopper.manager.issuelink.EpicLinkManagerImpl.getEpicLinkType(EpicLinkManagerImpl.java:484)
[INFO] [talledLocalContainer] at com.atlassian.greenhopper.manager.issuelink.EpicLinkManagerImpl.getEpic(EpicLinkManagerImpl.java:79)

 

What is the right way of using this class?

1 answer

1 accepted

1 vote
Micky Caritte Community Champion Nov 30, 2017

Hi again Martin!

After some researchs, it seems like the Custom Field Epic Link with a key should be enough. Make sure your script will then reindex the issue.

That should do the trick, let me know if you try it, I'll probably give it a chance tomorrow through script runner :)

Cheers

Thanks! I think I got it this time, I am uncertain but the value was not written correctly. After rewriting the section using the Id of the custom field for saving it now works! Thanks!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Schuster
Posted Mar 28, 2018 in Jira Software

Can a company’s culture make or break agile adoption?

Can a new-to-agile team survive and thrive in a non-agile culture? If so, what advice would you give to those trying to be agile in a non-agile culture? What's the key(s) to success? Share your thoug...

12,054 views 15 13
Join discussion

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