Is there a way to determine to whcih project a custom field belongs to?

Let's say I have 2 projects, p1 and p2.  The create issue screen for each project has customfield_1  and customfield_2 respectively.

 

GET api/2/filed returns all fields.

 

Am I correct in thinking that all fields are returned but there is no information to identify to which project the custom fields belong to?

 

To get around this, one way would be to prefix the custom field name with a project identifier when creating it?

 

3 answers

This widget could not be displayed.
Steven Behnke Community Champion Nov 02, 2017

Please don't do that. I have been paid professionally to clean up configurations like that. If you scale that sort of configuration out Jira will become very difficult to search and use.

Custom Fields are NOT for projects. You are thinking about it wrong. Custom Fields are more or less global. Use the createMeta and editMeta REST endpoints to discover which fields are in-use by a project. Using the Custom Field name is not a good idea.

This widget could not be displayed.
Alexey Matveev Community Champion Nov 02, 2017

Hello, 

You need to use the following rest function 

rest/api/2/issue/createmeta?projectKeys=QA&expand=projects.issuetypes.fields

But it does not tell you which fields are on the screen. It will just tell you what fields are defined for the project in the layout scheme.  

This widget could not be displayed.

Thanks for replies.  I was thinking about this on the way home last night and came to the conclusion that custom fields are "global" to JIRA and by adding them to project screens (e.g. issue create) , they become available for use when creating an issue in the project.

 

Our application will need to create a custom field, then add it to a particular  screen for a project.  We need to associate the custom field id to a particular parameter in our projects.

 

The body from the results of a search, converted to a String, will need the "customfield_xxxxx" replaced by our parameter name in order to use Jackson objectmapper - since we cannot define the properties in the class they are unknown until they are created.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

78 views 1 0
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