I would like to run a JQL query to look up issues with certain criteria based on some fields selected on the jira (custom fields) and check if the query returns any results. If it does return results, I want to fail the validation in the transition.
Is this currently possible? If yes, please advise on how should that be done.
You can use Script Runner plugin as already suggested by Nic. Script Runner provides a "Allows the transition if this query matches a JQL query" script as a workflow condition. This won't already match your requirement, but it's a good starting point.
Henning
Hi Henning, so I'm now happy to use Conditions instead of Validators and I'm using Script condition and use the jqeury condition check and when i use hardcoded values, it does work, but when i try to use variables (values from custom fields) it doesn't like it..
This works well:-
(fixVersion="7.4.0")) OR (fixVersion="7.4.0" and status not in (Verified, Closed)
This doesn't work:-
(fixVersion=cfValues["Deployment Version"]?.value)) OR (fixVersion=cfValues["Deployment Version"]?.value and status not in (Verified, Closed)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, thats because the second term is not a valid JQL term.
To make this possible you have to script your own condition. If you look at this answer https://answers.atlassian.com/questions/151633/bulk-changes-is-there-a-way-to-concatenate-a-new-fixversion-when-doing-a-bulk-change-as-opposed-to-completely-replacing-the-fixversion you can see how to do a JQL search in your own script. Within your own script you can read the values of the customfields and relplace them before you execute the search.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My needs were resolved by using Workflow Enhancer which can add a boolean validator using various fields. This is also a free add-on.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alternative: use JJupin, it has a routine to help you select the issues you want, and maybe process it ...
http://confluence.kepler-rominfo.com/display/SIL/selectIssues
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
JQL not so possible however if you can try to create a transition validator based on a custom field value yes it is doable.
You can try using the following JIRA plugins which have the workflow transition validator function:
Hopefully it helps!
Cheers :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daryl, I need to lookup statuses from other jiras based on criteria defined on the current jira to determine if the transition should be possible or not.
So what we do have is, say, a version and i need to lookup all bugs linked to that "version" based on a "not verified" status which doesn't exist on the current jira (and hence i need to run JQL). If there are results, the case should FAIL, if there are no results, the case should PASS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daryl, I need to lookup statuses from other jiras based on criteria defined on the current jira to determine if the transition should be possible or not.
So what we do have is, say, a version and i need to lookup all bugs linked to that "version" based on a "not verified" status which doesn't exist on the current jira (and hence i need to run JQL). If there are results, the case should FAIL, if there are no results, the case should PASS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You'll need to find or write a validator to do that somewhere else - although the plugins Daryl mention are powerful, none of them contain a function that will cover this requirement.
Your business logic is quite specific to yourself here, so I'm not sure anyone will have written anything flexible enough to be used for it.
So, as usual, I'd recommend looking at the script runner plugin, as that can provide framework into which you can code your logic without having to write a whoel plugin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.