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

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

This widget could not be displayed.

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.");
}
This widget could not be displayed.

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. 

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

This widget could not be displayed.

 @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 

This widget could not be displayed.

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

54 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you