"Simple scripted validator" is not working

Edyta Łakomy November 27, 2014

Precondition:
We have uploaded roovy Script Runner plugin.

Steps:
1. Open workflow in edit mode and select first transition "Create issue".screen3_script.png
2. Go to "Add validator" screen.
3. Select "Script validator" -> "Simple scripted validator"
4. Select one of build-in scripts e.g. "Has one or more attachments".
5. Enter text in "Error Message", "Field" is left empty.
6. Save and publish changes (+refresh web browser CTRL+F5).
7. Create new issue:

  • fill in all mandatory fields,
  • add one attachment

Result:
Upon pressing "Create" system displays error message entered in po. 5.
Generally system displays error message ALWAYS, no matter whether condition is validated to true or false.

Please help.

4 answers

0 votes
Edyta Łakomy November 30, 2014

Thank you very much for prompt reply.

 

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.
November 28, 2014

You can't get attachments like this, because they are not available to the attachment manager until the transition has completed. IIRC you will need to check the current HttpRequest, which I don't have the code for off the top of my head.

0 votes
Edyta Łakomy November 27, 2014

screen2_validator.png

0 votes
Edyta Łakomy November 27, 2014

screen1_create.png

Suggest an answer

Log in or Sign up to answer