Forums

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

How do determine the custom field number for epic name

Quest Henkart
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 10, 2019

Hello, I am creating a Jira Connect app that involves me creating an issue via the v2 API. When trying to create an epic, I get the error that the epic name must be set. However it turns out that the epic name field is an arbitrary custom field that is different on every environment.

 

I can hard code the custom field to get it to work (10011 for me), but I need to be able to do this programmatically so that it works for anyone. Is there a way to use a static key to set the epic name field? If not, how do I get the custom field id for the epic name?

 

The epic field name is 100% unnecessary for my uses as it will just be a duplicate of the summary field. So if there is a way to skip setting this field that would be optimal. 

 

There is a frustratingly lack of information about this interaction in the docs

1 answer

0 votes
José León _Sistel_
Contributor
February 11, 2019

You must not use field id hard coded, you must get the field object by name first:

customFieldManager.getCustomFieldObjectByName("custom-field-name");

Quest Henkart
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 12, 2019

Thank you for the response. How would this be done using the REST api. i am creating a Jira epic from a 3rd party app so I do not have access to these methods 

Daniel Mitchell
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 1, 2019

https://yourserver.atlassian.net/rest/api/2/field

Parse the result, find 'epic name' in there. (Not sure how it works in non-English environments, sorry)

Like Gavin D_ likes this
Sanjeev Deshpande
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 28, 2020

Thanks Daniel. This really is a helpful answer and solved lot of trouble for me

Suggest an answer

Log in or Sign up to answer