About making a field mandatory in Resolve screen

Vinod Narayanan October 11, 2015

Hi,

I was working with JIRA 4.3.3. I am trying to apply a 'Custom field' as mandatory when resolving an issue. I arrange the field to be Appear/Available in the 'Resolve issue' screen. Also I set it as 'Mandatory'. But right now I am facing an issue with 'Create' issue. As I made this field as mandatory I am not able to create the issue as it is asking for the 'Custom field' to fill. Is there a way to add a new Issue Operation other than 'Create/Edit/View'?
Or is there anyway to configure this successfully. This is urgent. Please help.

Regards,
Vinod

5 answers

1 vote
Michael Kornatzki
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 11, 2015

Hi, i am doing the same with ScriptRunners Behaviours.

In a script you can get the transition and if you want you can make fields mandatory, readonly, valid/invalid, ...

Vinod Narayanan October 12, 2015

Hi Michael, Can you please share the scripts? Best Regards, Vinod

Michael Kornatzki
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 12, 2015

Well, not the complete Script but snippets/hints. You have to write a groovy-script for Behaviours-Plugin Then you can check for Transition with private boolean isTransitionResolve() { if (getAction() != null) { return getAction().getName().equals("Resolve Issue") } return false } And set a field mandatory with: FormField formCustomField = getFieldByName("YourCustomField") if (isTransitionResolve()) { formCustomField.setRequired(true) } else { formCustomField.setRequired(false) }

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.
October 12, 2015

Or just use a validator, such as cfValues['Some Field'] (Yes, that's it, that's all you need for "custom field is mandatory on this transition", if you use a validator)

0 votes
JiraYo
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.
April 23, 2019

I used the JVME plugin to do this today as a workflow validator.

 

simply select "Fields Required Validator (JMWE add-on) " as a validation step and the red asterisk will appear on the field that requires content. You can even add a message to the user if they dont fill out the field. nice...

0 votes
Bogdan Gorka
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 13, 2015

When I face similar challenges I find this book very helpful: JIRA 6.x Administration Cookbook

One way to solve your problem is explained step by step in chapter: Making a field required during workflow transition. It is also based on ScriptRunner. However, I did not not test it so I am not sure how it works in practice. 

Vinod Narayanan October 15, 2015

Hi, I have installed Behaviours Plugin to jira. And added the custom field and it's validate check at 'Resolve' stage. But still when I try to create the issue 'The field' required message appears. Best Regards, Vinod

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.
October 15, 2015

You have not removed the "field is always mandatory" flag in the "field configuration"

Vinod Narayanan October 16, 2015

Sorry, Mic. I didn't get you. Are you referring a code? Or is that an option in Field Configuration Scheme? Or is it in Behaviours Plugin? Best Regards, Vinod

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.
October 16, 2015

I did say "Field configuration"

Vinod Narayanan October 18, 2015

Are you saying about the latest Jira version (Jira 6.0)? I was working with Jira 4.3.3 In that there is no option to Remove/Add 'Field is always mandatory'. The only option is (Optional/Mandatory) for field. Or if you are saying anything with script please explain. Thanks for the valuable comments. I have installed Behaviours Plugin in jira and configure the field too. But not working. Best regards, Vinod

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.
October 18, 2015

Field configuration has not changed much since version 3. As I said, make the field optional in there.

Vinod Narayanan October 18, 2015

Hi Nic, I haven't used any script validators to achieve this. Please let me know where should I input the scripts if I am applying them. I have installed 'Behaviours' plugin and added this field and configure it in such a way that Conditions: When: For action: Resolve Issue (5) (Delete) Except: For step: Open (1) (Delete) And made it 'Required' too. As you said to make it 'Optional' in field configuration then I am able to create the ticket and able to view the custom field in 'Resolve' screen but the thing is it is not 'Mandatory' there. What I am trying to achieve is the Custom field should be visible only in 'Resolve' screen and 'Mandatory' too, so anybody can't leave it blank and make the issue resolve. While I made it Mandatory in Field configurations the ticket won't create even though I have defined the same with behaviours. And when I make it optional it fails to achieve the requirement :-( Is there anyway to add a new Issue Operation like and otherthan 'Create/Edit/View'? If so we can create a 'Resolve' Issue operation and associate the screen to this operation and make the field Mandatory. Thanks in advance. My Skype Id is :vinuv7, If you don't mind we can talk in detail. Due to restrictions I am able to post one question/day. So the issue resolution is delayed. Best Regards, Vinod

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.
October 18, 2015

To summarise what has been said before, as you don't seem to be putting it together correctly: 1. You make the field *optional* in the field configuration 2. You add a validator to the transitions where you want to make it mandatory

0 votes
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.
October 12, 2015
0 votes
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.
October 11, 2015

Note that you had no way to tell JIRA where you wanted the field to be mandatory.  You don't get this because it isn not there.  A field is either optional or mandatory for the whole lifecycle of the issue.

TO make the field mandatory, you need to implement a validator to check the value of the field during the transition on which you want to enforce entry.  You'll be able to find such validators in add-ons - the JIRA Suite Utilities is the one I tend to use (free, well supported and been around for years)

Suggest an answer

Log in or Sign up to answer