Required field on specific screens

Steve Gallant January 22, 2016

Hello there,

I'm trying to set up a JIRA project where a specific field (custom comment field) is required when closing a ticket prematurely (ie - not going through the full deployment process). Here's my problem:

  • I've made the field required in the custom field configuration
  • Assigned all the necessary schemes
  • The field is only visible on a specific screen that appears only when trying to transition the ticket to a "won't fix" status OR is the custom view screen that I have set up in my screen scheme
  • When I try to submit the ticket, it won't allow me as I don't have any info in the custom comment field

I'm hoping I'm just going about this the wrong way, but is there not a way to achieve this?

Thanks in advance.

cc: @Enzo Licata

 

3 answers

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 22, 2016

If you set a field as mandatory in the field configuration, then it is mandatory for the issue type.

The screens have nothing to say about making fields mandatory, all they are is a list of fields to show the user.

You need to look at the workflow to do this - make the field optional again, so you can create issues, then look at the "premature close" transition in the workflow.  Add a "validator" which checks for "custom comment field is not empty" and that will force users to enter it when they try to use the transition.  You will need to install an add-on to do this, but the JIRA Suite Utilities is free (And pre-installed on Cloud)

0 votes
Steve Gallant January 25, 2016

Thank you Nic and Gabrielle. That helps a lot and makes me feel less crazy.

GabrielleJ
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.
January 25, 2016

Glad to have helped you feel that way 

0 votes
GabrielleJ
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.
January 22, 2016

Making a field Required in the "Field Configuration" will only required it when it was being presented in the screen (like Create/Edit screen) then JIRA will not allow you to proceed if that field does not have a value.

Reference: https://confluence.atlassian.com/jira/specifying-field-behavior-185729654.html#SpecifyingFieldBehavior-Makingafieldrequiredoroptional

So, what do you want to do here is make a certain field available only to a certain transition (like Close). To do this, create a workflow "Validator" in the close transition

Reference: https://confluence.atlassian.com/adminjiraserver070/advanced-workflow-configuration-749383189.html#Advancedworkflowconfiguration-validators

ChenSkyBox May 15, 2018

can you explain how to do the validator?
i dident got that on the transition under validator

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2018

This is explained in the link Gabrielle gave.  You need to edit the workflow, find the transition and select it, then you get a box with "validator" as one of the tabs.

allie ruby March 3, 2021

This was very helpful - thank you so much for providing the link and explanation!

Suggest an answer

Log in or Sign up to answer