How to save an Issue as a custom field with IssueInputParameters Edited

Wrote a plugin to auto create several tasks linked to an Epic. Now trying to assign these created tasks to the Epic (I also link them but assigning them to the Epic makes it easier to use). I can see the "Epic Link" and "Epic Name" custom field values and noticed that Greenhopper is using IssueImp for the Epic Link custom field: XX-1234 (toString) class com.atlassian.jira.issue.IssueImpl (getCLass.toString)

I am using IssueInputParameters to create my tasks. Just using addCustomFieldValue on "Epic Link" to add the Epic Issue (Issue class) to indicate that these created tasks are in the Epic does not work. Using a MutableIssue of the Issue as data to store does not work either: error: no suitable method found for addCustomFieldValue(String,  MutableIssue / Issue / Object

What is the right way to store a complex object like IssueImp or Issue as a custom field? I personally would store a key as link in a custom field but because this needs to work with Greenhopper I need to store it in the same format so I can't change that approach. Thanks!


Examples were asked:

IssueInputParameters issueIP = this.issueService.newIssueInputParameters();




issueIP.addCustomFieldValue("Epic Link", (Object) issueManager.getIssueObject("XX-1234"));

IssueService.CreateValidationResult issueinput = issueService.validateCreate(user, issueIP);


Compile error:

error: no suitable method found for addCustomFieldValue(String,Object)

Trying  Issue:

issueIP.addCustomFieldValue("Epic Link", Issue);

will result in 

error: no suitable method found for addCustomFieldValue(String,Issue)

Similar for MutableIssue

2 answers

1 accepted

1 vote

The epic link is not an issueimpl. 

You can use EpicLinkManager.associateIssuesWithEpic( <epic>, <list of issues> ) to associate the issue with the Epic.

Thanks Nic! I was looking for storing more Objects than just the example for Epic above but I would definitely prefer to use that API for the Epic linking. I am surprised you mentioned that it is not a IssueImp as thats what I got back from a getClass.toString().


Any advice you can give in regards to storing any other complex objects or is the addCustomField pretty much only accepting String input?

Most custom fields need objects that represent their content.  For numbers, that's easy - int, long and doubles can all go in.  Text fields expect strings, dates expect Timestamps, and so-on.  The Jira specific types are ones like users and "options" (for most fields that are selects or radio or checkmarks).  Field with multiple values need arrays of those objects.  So a select list expects one option, and a multi-select expects an array of options

Although I have a nagging doubt that some of them changed slightly recently - select lists may be expecting singleton objects containing one option.  I need to dig that code out...

Thanks Nic, that explains a lot and will help with my other items for the auto created tasks!

Concerning greenhopper, I can add jira-greenhopper-plugin to my pom.xml however com.atlassian.greenhopper.manager is not in that jar and cannot be imported 5.6.2 from

The greenhopper stuff is really very old, and you should be importing Jira Software stuff really (Although it's not been refactored in full, so there are references to GH and Agile in it still)

Thanks! I cannot find the EpicLinkManager in any other package, am I missing an obvious newer version?

Never mind, copy paste mistake:


took care of it


I have been trying to complete this call but I have reached a dead end. I am unable to inject the EpicLinkManager or the EpicLinkManagerImpl class. At this point I simply create a EpicLinkManagerImpl and then call a getEpic of that new class. That crashes though even if the issue has an epic link:

[INFO] [talledLocalContainer] 2017-11-29 18:59:51,763 http-nio-2990-exec-3 ERROR [o.a.c.c.C.[.[localhost].[/jira].[action]] Servlet.service() for servlet [action] in context with path [/jira] threw exception [java.lang.NullPointerException] with root cause
[INFO] [talledLocalContainer] java.lang.NullPointerException
[INFO] [talledLocalContainer] at com.atlassian.greenhopper.manager.issuelink.EpicLinkManagerImpl.getEpicLinkType(
[INFO] [talledLocalContainer] at com.atlassian.greenhopper.manager.issuelink.EpicLinkManagerImpl.getEpic(

What am I doing wrong?

0 vote
Alexey Matveev Community Champion Nov 17, 2017


If you provided a script which does not work, it would be simpler to answer and if the script was straight to the point, it would be even  simpler.

I just added the snippets in question, with a very straight to the point code sample

Alexey Matveev Community Champion Nov 17, 2017

Try this

issueIP.addCustomFieldValue("Epic Link", issueManager.getIssueObject("XX-1234").getKey());

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 21, 2018 in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

1,253 views 10 18
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