I'm wondering if anybody has written a Custom JQL Function in ScriptRunner that would let you use JQL to select issues based on the count of the number of versions in fixVersion, affectedVersion, etc.?
I'm envisioning something like:
project = PROJ AND issueFunction in versionCountGreaterThan("fixVersion", 1)
to find all the issues where the count of versions in the fixVersion field is greater than 1, or:
project = PROJ AND issueFunction in versionCountNotEqual("affectedVersion", 1)
to find all the issues where the count of versions in the affectedVersion field is not equal to 1.
I looked at the Custom JQL Function examples in the docs, but being a Python guy and not a Java guy, it didn't quite "click".
Hi @eddyg
I'm a bit unclear about your question.
Are you trying to filter the version in the Multi-Version field based on the version set for the fixVersion field and the affectedVersion field?
If you intend to filter the Mult-Version field, JQL is not the correct approach.
You will need to look into the Behaviour and REST Endpoint.
A similar solution has been suggested in this Community Post.
I hope this helps to solve your question. :-)
Thank you and Kind regards,
Ram
Hi Ram! First, thanks for taking the time to read my question!
I’m pretty sure I really want a custom JQL function. 🙂
I’m not interested in querying fixVersion, affectedVersion, or other multi-select fields by version, but by the count of versions in a multi-select field.
For example, imagine these three issues:
PROJ-234 has fixVersion = “1.0, 1.1, 1.2
PROJ-345 has fixVersion = “1.2, 1.3”
PROJ-456 has fixVersion = “1.2, 1.3, 2.0”
This query:
project = PROJ AND issueFunction in countGreaterThan("fixVersion", 2)
would return PROJ-234 and PROJ-456 because the count of versions in those issues is > 2, but PROJ-345 would not be selected by such a custom JQL function because it only has two versions.
A query function that queries a multi-select field based on the count of values selected would be useful for finding the issues that have affected the most versions, issues with the most labels, etc.
So it’s not about the versions, it’s about the number of version entries. I hope that clarifies things! Thanks again for your time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I thought of some existing functionality that is similar to what I'm looking for.
ScriptRunner includes this custom JQL function:
issueFunction in hasComments("+5")
which returns issues that have more than 5 comments.
I'm basically looking for an equivalent JQL custom function, but instead of being for comments, it's for multi-select fields (like fixVersion).
So something like this:
issueFunction in hasCount("fixVersion", "+2")
would return all the issues that have more than 2 versions in the multi-select field fixVersion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.