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
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)
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
There are several scripted validator examples in the docs - https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/validators/simple-scripted-validators.html
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)
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 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...
It looks like you're new here. Sign in or register to get started.