It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to make comments mandatory if certain value from checklist is selected?

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

2 answers

0 votes
Joe Pitt Community Leader Sep 16, 2019

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. 

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

881 views 7 24
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you