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

Why are there so many custom fields in issue via ReST API?

Robert Carson May 6, 2014

Why are there so many irrelevent custom fields in an issue when pulling it from the ReST API?

u'customfield_10000': None,
u'customfield_10001': None,
u'customfield_10003': None,
u'customfield_10004': None,
u'customfield_10005': None,
u'customfield_10010': None,
u'customfield_10020': None,
u'customfield_10025': None,
u'customfield_10040': None,
u'customfield_10050': None,
u'customfield_10051': None,
u'customfield_10052': None,
u'customfield_10075': None,
u'customfield_10080': None,
u'customfield_10081': None,
u'customfield_10154': None,
u'customfield_10156': None,
u'customfield_10157': None,
u'customfield_10158': None,
u'customfield_10161': None,
u'customfield_10163': None,
u'customfield_10165': None,
u'customfield_10167': None,
u'customfield_10168': None,
u'customfield_10170': None,
u'customfield_10250': None,
u'customfield_10252': None,
u'customfield_10253': None,
u'customfield_10254': None,
u'customfield_10255': None,
u'customfield_10264': None,
u'customfield_10276': None,
u'customfield_10278': None,
u'customfield_10279': None,
u'customfield_10280': None,
u'customfield_10281': None,
u'customfield_10282': None,
u'customfield_10350': u'101662',
u'customfield_10550': None,
u'customfield_10652': None,
u'customfield_10750': u'108896',
u'customfield_10751': None,
u'customfield_10753': None,
u'customfield_10754': None,
u'customfield_10755': None,
u'customfield_10756': None,
u'customfield_10758': None,
u'customfield_10759': None,
u'customfield_10761': None,
u'customfield_10762': None,
u'customfield_10763': None,
u'customfield_10764': None,
u'customfield_10765': None,
u'customfield_10766': None,
u'customfield_10957': None,
u'customfield_11157': None,
u'customfield_11350': None,
u'customfield_11850': None,
u'customfield_12150': None,

This issue type only has 2 custom fields and the Summary field listed in the Screen configuration. In fact ALL screens for this issue type only have the same 3 fields. I am seeing this in Jira 6.0.6, but I just feel this is bad behaviour, it seems that every custom field in the system is attached to ALL issues in some way.

5 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Andreas Ebert
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2014

Take a look at the context of those custom fields. Are they available for all Issue Types and for all Projects? If yes, then they are available -- in principal -- to all Issues. Them being on no Screens only means that users can't set the value of these Fields (the value can still be set in post-functions). I guess that's the reason why the Fields appear in the JSON.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 6, 2014

Yup, the screens are there just for the web front end, they don't affect the data, and there's little point in REST trying to replicate the whole lot. You'd also get into having to tell Jira which screens you want to filter your results through, for each project and issue type you were requesting.

Field context is about the only useful filter that Jira can apply here.

Robert Carson May 6, 2014

Thanks for the Answer, I couldn't figure out where they were comming from. This makes sense.

1 vote
BenjiI
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2014

You probably have to check your custom field configuration. Goto Admin > Issues > Custom Fields and there check the available contexts column for the unwanted fields in your REST output. Their available context is probably set to something like Global (all issues) which make them appear in the results for all issues (not only the one you are mentioning in your REST call).

To make them disappear you have to set the available context specifically to those issues in which the custom field has to appear. In general it is always good practice to narrow the available context for all custom fields (if possible ofcourse).

Robert Carson May 6, 2014

Thanks for expanding on the answer above. +1

0 votes
Robert Carson May 6, 2014

Thanks for expanding on the explaination above! +1

0 votes
BenjiI
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2014

You probably have to check your custom field configuration. Goto Admin > Issues > Custom Fields and there check the available contexts column for the unwanted fields in your REST output. Their available context is probably set to something like Global (all issues) which make them appear in the results for all issues (not only the one you are mentioning in your REST call).

To make them disappear you have to set the available context specifically to those issues in which the custom field has to appear. In general it is always good practice to set the available context for all custom fields (if possible ofcourse).

0 votes
Robert Carson May 6, 2014

Also note, this isn't just an issue with custom fields, it looks like ALL fields show up in the JSON response when pulling issue from the ReST API.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events