About making a field mandatory in Resolve screen


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.


4 answers

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, ...

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

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) }

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

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)

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. 

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

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

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

I did say "Field configuration"

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

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

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

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,906 views 19 22
Read article

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