How to check if checklist is filled

Hi 

We have installed a Checklist plugin which provides a text field in which a checklist is stored in form of bullet point items. The plugin does not deliver a validator checking if the list is filled on transition so as workaround we are trying to perform a Script Runner check. The code we use is: 

import com.opensymphony.workflow.InvalidInputException
if ( cfValues['Acceptance Criteria'] ) {
	invalidInputException = new InvalidInputException("Acceptance Criteria should be filled before starting progress")
}

We get an error as expected but without the content from the Exception: 
Screen Shot 2015-02-25 at 14.14.40.png

How can we succeed with this check using Script Runner? 

Thank you, 
Anna 


Related: https://bitbucket.org/Whyves/checklist/issue/21/checklist-validator-is-filled 

3 answers

Hi Anna,

Checklist comes with a validator. Maybe it is not what you are looking for?

Please take a look at:

http://okapya.com/checklist/validating-checklist

Yves

I see Yves has answer, but it depends on the type of object that is stored in the custom field.

Hello and thank you for looking at this issue! 

The Checklist plugin delivers only one validator which "Validates if a checklist has some or all items checked", it is useful on Close transition. But it will not check if there are any items are on the list, which is what I need on the Start Work transition. The related request to the Checklist plugin developers is about adding such validator to it.

That is why I wanted to check how to support this with Script Runner. Currently my issue is that error message from the thrown InvalidInputException does not display after clicking Start Work in case when list items are empty - as a note: the transition does not have its dedicated screen. Anyhow the code is working correctly. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

333 views 0 1
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