"Simple scripted validator" is not working

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

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.

Thank you very much for prompt reply.

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

418 views 7 5
Join discussion

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