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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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) }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have not removed the "field is always mandatory" flag in the "field configuration"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did say "Field configuration"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Field configuration has not changed much since version 3. As I said, make the field optional in there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are several scripted validator examples in the docs - https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/validators/simple-scripted-validators.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.