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

Not able to create Epic issue type using Jira REST Java Client (JRJC)

Shane Mc May 6, 2013

I'm having trouble create issues of type Epic via JRJC. I have managed to add stories and sub-tasks but when I try the same sort of code as the Story for an Epic issue type I get an exception message indicating the field "Epic Name" is required:

Exception in thread "main" com.atlassian.jira.rest.client.RestClientException: Epic Name is required.
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:68)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.impl(AbstractJerseyRestClient.java:164)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.postAndParse(AbstractJerseyRestClient.java:152)
at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.createIssue(JerseyIssueRestClient.java:398)

Looking at JIRA it seems this is a custom field (customfield_12601) but it is not obvious how I should set this using the issueBuilder.

Here is an example of what comes back in this field when I make a GET request using REST:

Field{id=customfield_12601, name=Epic Name, type=null, value=Test epic issue}

As per a comment by Alexsander Merzwicki on another thread I tried to using the following but it did not work for me.

IssueInputBuilder.setFieldValue("customfield_12601", "Epic name")

I also attempted the following with no success either:

FieldInput fInput = new FieldInput("customfield_12601", ComplexIssueInputFieldValue.with("value", "Epic name")); 
issueBuilder.setFieldInput(fInput);

Has anyone else managed to do this? Is there any documentation you can direct me to for this? Thanks.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Shane Mc May 6, 2013

Sorted!

There was a small typo in my original implementation of Alexsander's suggestion - this is the actual syntax which works:

IssueInputBuilder issueBuilder = new IssueInputBuilder("ProjID", 10L);
issueBuilder.setFieldValue("customfield_12601", "Epic Name");

Thanks Alexsander.

TAGS
AUG Leaders

Atlassian Community Events