How to check if checklist is filled

Anna S February 25, 2015

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

0 votes
Anna S February 25, 2015

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. 

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2015

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

0 votes
Yves Riel [Okapya]
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 25, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events