Hello,
On issue creation page we have a custom field which has four values. One of them is "Could not be checked".
Now when this value gets selected I would like to make comment box mandatory for creating the issue.
Can someone please look into this?
Thanks,
Suhas
Hi Suhas,
This can be achievable if you are using ScriptRunner plugin. There is a Behaviour module in this plugin which you can use to make the any custom field mandatory based on value from other custom field on issue creation screen itself. Below is one of the possible solution,
1. Go to Add-On page. Click on "Behaviours" from left navigation pane.
2. In the "Add Behaviour" section, provide name and description and click "Add".
3. Click on "Fields" link against this new behaviour and add both the fields. Select list custom field and Text fox field.
4. Click on server side script for select list custom field and provide below script. (Please provide exact text box custom field name in the script).
def formSelect = getFieldById(getFieldChanged())
def comments = getFieldByName("Your Text Box Custom Field Name")
String formSelectValue = formSelect.getFormValue()
if (formSelectValue == "Could not be checked") {
comments.setRequired(true)
}
5. Click on "Save" Button. Go to Behaviour page again and click on "Add Mapping" link against your newly created behaviour.
6. A pop up will appear and you have to provide your project name to map this behaviour. You can restrict this behaviour up to issue type level as well, else let it be default.
Regards,
Rakesh
Not sure if you can add comments when creating an issue. You could make the Description field required with a Behaviour, as others have noted. Or add a validator to require some text in some field on the next transition after Create
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're going to need a listener since you want to dynamically check to see of a value is selected. I don't use them so I can't help.
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.