Changes to Custom Fields' implementation requiring action from you

I would like to second Yves on avoiding multiple versions for different Jira versions. It is really a headache for us.

@DamianKedzierski we use bridges in our plugins to make unified versions for Jira 7 and Jira 8. In bridge we basically encapsulate some Jira service / manager beans (those are the ones have different interfaces in Jira 7 and Jira 8) with 2 different adapters and selectively enable those adapter beans based on Jira version. I think it will be not helpful in this case since we are dealing with CustomFieldType interface and not a service bean. There is no way I can think of we selectively give Jira 2 different CustomFieldType implementations based on the version. Once we try to put NonnullCustomFieldProvider in our codebase it will basically not compile for any previous version of Java 8.10 due to missing Class.

If anyone have a good idea to how to make things backwards compatible in a single codebase I would really like to hear that because we really don’t want to return back into creating and uploading 4 jars for a single version (x2 from Jira7/Jira8, x2 from Datacenter/Server) and managing 2 different branches.

@kubilay @yvesriel @a.belostotskiy We are currently working on the approach that would allow vendors to compile and run their apps across different Jira versions. We will keep you updated, as soon as tests will finish successfully :slight_smile:.

3 Likes

That would be something we can really benefit. Waiting to hear good news on that :slight_smile:

brilliant news :slight_smile:

Awesome! You make our day! :tada:

Hi @DamianKedzierski,

Our use case which differs from other fields is mostly about Options. In the different Atlassian fields, the data stored in the custom field is simply the selected Option(s). So during a re-index, they don’t need to call the OptionsManager as they simply index the value that they have. It doesn’t matter to them if options have been added/removed in the mean time.

Now, in our use case, all Options are always added to our custom field data. So during a re-index (e.g. after Options have been addes/removed) we need to call the OptionsManager and index all their Option values into every issue matching the custom field’s context.

So, with the new API, we need to call the OptionsManager once to see if their is anything to index and let you know about it. Then, even when you only return to us what needs to be indexed, we still need to call OptionsManager again to do the real job. So in our case it amounts to doing the job twice.

That’s why it’s faster for our customers to not implement the new API.

Yves

I would really love to see that :muscle: please keep us updated :slight_smile:

Hi @DamianKedzierski

We spent today trying to use the new “Custom field indexing” page to check if our custom fields cause any problems, but without any success.

We usually test on non-clustered installations, and that screen is not accessible even using a DC license. (It would be nice if it were.) We updated our scripts to start a clustered test server (albeit with a single node), so we can access the stats page now. But it doesn’t seem to be showing what it should.

We tried both blocking and background full-reindexing, but the data shown on the metrics page is not affected. It only shows system fields (which seems unlikely, we have lots of custom fields on the test database), ‘snapshot’ and ‘total’ stats are identical, the “Calls to indexer” column shows numbers much lower than our issue count, and the text at the top says “Last data update on node node_single: 25/Jun/20 3:43 AM”. (The date seems legit, but the time is a long time before we even starting working on this.)

Any idea what’s wrong with it?

@dmihalache Thanks for reporting that!

We found a bug in 8.10.0 excluding custom fields indexers from these stats. It will be fixed in 8.10.1 and 8.11.0

@yvesriel With 8.10 we added a new method to FieldIndexer:

void addIndex(final Document doc, final Issue issue, final CustomFieldPrefetchedData prefetchedData)

The default implementation will ignore prefetchedData, but as your indexer overrides it you may simply read the value from it without the need of recalculation.

Does it satisfy your use case?

Could you elaborate a little on single and multi select custom fields which uses contexts defined per project? Comparing for example 1 global context for 500 projects vs. 500 contexts for 1 project each? Does each context has their own index?

Hi @Holger,

Jira stores fields in the same index regardless if global or local context.

Would you like to describe your use case, so we can provide more detailed answer?

Thanks,
Damian

Hi @DamianKedzierski,

I just wanted to ask if there is any new information in this functionality?