Custom Fields

I have a weird situation where I am battling to get the some  custom field sets in synch across my projects.

The State custom field is defined with a specific set. When a new project is created the field is added from the Existing list of fields and when the list is edited is is done either by using the existing for all projects option or via admin/custom fields/field list. Yet it seems like the set gets out of synch. For new project the easiest to fix this is to remove the field and add it again but this is where it gets even weirder.

The custom field I select indicates that it is being used by 22 projects

When I add it to the project is shows that it is being used by 2 projects

What am i missing here and what would cause the defined set for a custom field to go out of synch?

As far as I can determine there is no WF that updates the set for this custom field.

0
4 comments

Hi Anton,
I'm Stan from the YouTrack Team. Thanks for reaching out!

A custom field and its set of values are two separate objects. The field itself can be attached to any number of projects, and separately, each of those attachments points to a set of values, which can be shared across many projects or exist as an independent copy for just one.

The "22 projects" count on the field's Fields List page counts every project that has the State field attached, regardless of which set of values each one uses. The "2 projects" count you see when adding or viewing the field on a project counts only the projects whose attachment points to that exact set of values. Both numbers can be correct at the same time: it would mean only 2 of your 22 State field attachments reference this particular set, while the other 20 reference a different one, likely one that shares the name "State" and the same values, but isn't the same object.

To confirm this, open the field's Used in Projects tab (Administration > Custom Fields > Fields List > State) and check the "Set of Values" column for each project row. If it lists more than one distinct "State" set across those 22 projects, that confirms the split.

If that's the case, you can consolidate them from the same page: select State, then use Merge with to merge it onto the set that's shared across the 2 correctly-linked projects. The full procedure is described in our documentation here: Merge Values with Another Set.

Let us know if any questions arise! 

0

Thank you Stanislav Katsion for the explanation. But I'm still baffled by the fact that I continue to have this discrepancy across projects. When I first noticed this a while ago I went though all my projects, removing fields that are not universal and re-adding them from exiting fields hoping that this will mean that the value set available for the field would be consistent and remain that way as long as I do not edit the set for individual projects. 

Regarding the Merge option - Why would I have different options for different projects? For some I'd have the Merge option while for other I'd have the Replace option. 

0

A follow up questions - I'm testing the extent of the Consistency check function so I remove my State custom field from my test project and attempted to add a project specific version. I used the same field name, State. I realized that the existing State custom field used globally does not appear in the list of Set of Values? Why is this?

Regarding the Merge option - What determines which project are shown when choosing one to merge with? I notice that only some of my projects are shown but I do not see an obvious commonality. 

0

Hello Anton!

"Why would I have different options for different projects? For some I'd have the Merge option while for other I'd have the Replace option."

This depends on whether the set of values currently attached to the field is shared with anything else. If it's used only by that one field in that one project, you get Merge with. If the same set is also used elsewhere (another project, another field, or twice in the same project), YouTrack shows Replace instead, since editing it in place would change every other place that shares it. Clicking Edit for all projects switches into shared-edit mode, where Merge with becomes available even for a shared set.

"I remove my State custom field from my test project and attempted to add a project specific version. I used the same field name, State. I realized that the existing State custom field used globally does not appear in the list of Set of Values? Why is this?"

There's only one custom field titled State by default, the field itself is a single global object, that's what lets it be attached to 22 projects. What varies per project isn't the field, it's the set of values that project's attachment of the field points to. Two projects can use the exact same field while pointing at completely different sets.

When you removed State from your test project and added it back, YouTrack reused the same global State field (names have to be unique per type, so it can't create a second one), but it did not reuse the set of values your project had before. It assigned a brand-new one instead. Once removed, your old set had no project pointing at it anymore, and the Set of Values picker only lists sets that are currently attached to at least one field, so it disappeared from the list.

"What determines which project are shown when choosing one to merge with? I notice that only some of my projects are shown but I do not see an obvious commonality."

The merge list shows one entry per set of values, not per project, limited to sets used by at least one field of the same type as the one you're editing. A project won't show up on its own if it shares its set with another project that's already listed under one entry, if its field is a different value type, or if you don't have admin access to it. Each entry's label also only shows the first project name or two plus "and N more," so it can look like fewer projects are represented than actually are.

Please don't hesitate to reach out anytime if you have any questions or need any help!

0

Please sign in to leave a comment.