I want to find all issues via JQL that have a custom property set.
I am aware how to build searchable properties, but here I just want to find all issues that have the property, even when the property is empty.
Background: Finding all issues with a custom property (added by our add-on), check the content, and fix it (if it is empty or has an outdated structure.) So I cannot rely on searching “inside” the property!
My understanding of your scenario is that your field values conform to a schema and you want to upgrade the schema and any populated fields to conform to a new version of the schema.
I think you will have to iterate over all issues to upgrade their values, but if you anticipate needing to upgrade the schema again in the future, then you could introduce another field that identifies the schema version that the value of the first field conforms to. This additional schema version field could then be used to find only the issues with fields populated with values conforming to a specific version of the schema.
When you say “find all issues that have a particular property name”, I’d like to clarify if you are referring to entity properties or custom fields. My first response was based on the assumption you are referring to custom fields. If you are referring to entity properties, you can define them so they are searchable with JQL as per https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/.
@dmorrow Sorry, that I was not clear enough. The question is not how to make a searchable property, but to find all issues who just have a property(no matter what content inside the property). Here is Pseudo-JQL I am thinking of:
And yes, JQL works on this property just fine. But we started without a searchable property and now need to cleanup the issues with the old non-searchable structure.
Well, you can’t search for the property itself by its key, only for extractions defined in the entity property module in your descriptor. What do entity property module definitions in your descriptor look like?
Thank you for re-confirming that we cannot search for properties itself by its key.
From my understanding an issue and its jiraEntityProperties (configured by atlassian-connect.json) are only refreshed in the search index when they are created or updated.
So even when I now add an extraction to find issues with the old property structure, the search would be empty as these issues are not indexed unless they are updated after adding the extraction, right?
Is there a way to trigger re-indexing of all issues in a cloud instance including jiraEntityProperties (configured by atlassian-connect.json)?
So even when I now add an extraction to find issues with the old property structure, the search would be empty as these issues are not indexed unless they are updated after adding the extraction, right?
No, if you add a new extraction everything will become searchable immediately.
Indeed, the problem is that extractions on arrays of objects are not possible.
I don’t know what it is you’re trying to do, but perhaps the Bulk set issue property API would be helpful? With it, you can e.g. set your property to something else only on issues that don’t have that property set to anything.