Possible to force fill in custom field as required to change a status to "QA review"?

CaptainJonesy October 26, 2015

Hi, 

Just wondering if there is a way to force a developer to fill in/complete a custom field such as "Fix version" as an requirement before they can change bug status (status transition) to "QA Review"? This status is when the QA would regress the fix for the bug claimed to fixed by the developer.

I looked under Workflows/Transitions > Conditions and post functions and you can't seem to do it this way. Also attempted to set "Fix version" field under custom fields for "Required" and the "Fix version" is required for all screens (even when you create a new issue). So I thought customing within transition level would be easier than custom field level.

Does anyone have any ideas/suggestions how to implement this? 

 Thanks you for your help and assistance on this matter. 

Thanks,

Chris 

 

 

 

 

 

4 answers

0 votes
Kathy Tempesta October 27, 2015

Sorry, I didn't realize that was from an add-on but fortunately, it's a free one. You need to install JIRA Suites. It has a ton of really useful stuff in it, including the Required Field Validator option.

https://marketplace.atlassian.com/plugins/com.googlecode.jira-suite-utilities

Once you have it, you will wonder how you ever lived without it (and no, I don't work for the developer smile).

-Kathy

0 votes
CaptainJonesy October 27, 2015

 @Kathy Tempesta - Thanks for your input, I've attempted your suggestion and I have 3 options related to permissions of the user and nothing related to "Field required". Is this correct? Do I need to do something else for this "Field required" option to appear?  

 

Screen Shot 2015-10-27 at 11.06.52.png

Here below is the previous screen before to you some context for the transition at hand.

 

Screen Shot 2015-10-27 at 12.27.13.png

 

Thanks for all of your help on this matter. 

Thanks, 

Chris 

0 votes
Kathy Tempesta October 26, 2015

If all you want to do is make that field required for that specific transition, you can use a validator. Go to the desired step in the workflow and select the Validators tab. Choose Add Validator and select the Field Required option. Depending on what version oif JIRA you are using, you can either select the just field you want (Fix Version) or select the field and add a custom error message. 

Jeremy Gaudet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 26, 2015

Good point; my validator was actually comparing fields, I simplified it for this example. I forgot that the simplified version is built-in.

0 votes
Jeremy Gaudet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 26, 2015

You can do this with a custom script; I have similar ones to ensure that, at "Close" time, all versions listed in Fix Version/s are flagged as verified, against a "Verified Version/s" custom field.  You'd make it a custom validator on the "QA Review" transition in the workflow, something like:

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.project.version.Version
import com.opensymphony.workflow.InvalidInputException
import org.apache.log4j.Category

def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction");


ComponentManager componentManager = ComponentManager.getInstance()
CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()
CustomField fixVersionCF = customFieldManager.getCustomFieldObjectByName("Fix Version")

List<Version> fixVersions = issue.getCustomFieldValue(fixVersionCF)

if(fixVersions == null) {
        invalidInputException = new InvalidInputException("Fix Version is required for this transition.");
}

Suggest an answer

Log in or Sign up to answer