Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Simple Scripted Validator not showing defined Error Message when condition is not met

Marc Jason Mutuc
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.
December 23, 2014

When the condition is met, everything is fine. But when the condition is not met, it just tells the user the generic error message :

It seems that you have tried to perform an illegal workflow operation.

If you think this message is wrong, please contact your JIRA administrators.

 

Here is the error log. Changes some details such as username, etc.

2014-12-23 21:46:58,071 http-bio-8088-exec-21 ERROR username 1306x53162x1 10xnx6j 10.228.24.117,127.0.0.1 /secure/WorkflowUIDispatcher.jspa [scriptrunner.jira.workflow.ScriptWorkflowFunction] Script function failed on issue: issuekey, actionId: 41, file: null

[InvalidInputException: [Error map: [{customfield_12345=Defined Error Message}]] [Error list: [[]]]

17 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Ravi Go April 5, 2016
cfValues['My Single Select']?.value == "Some value"
worked for me. when i was getting similar errors as others.

Checked out the latest script runner docs. https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/validators/simple-scripted-validators.html

 

0 votes
Pieterjan Vanpee December 15, 2015

We have the same error with JIRA 6.3.15 and Scriptrunner 4.1.3.5.


Capture.PNG


When Sponsor is equal towards '?', we get following error:

 

It seems that you have tried to perform an illegal workflow operation.

 

If you think this message is wrong, please contact your JIRA administrators.

 

When Sponsor is NOT equal to '?' the workflow is going towards the next status without any problem?

Seems that the Validator is doing his job, although he is not showing the error message I defined.


Please help...

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.
December 15, 2015

This happens when the Sponsor field is not on the transition screen where the validator is, or there is no screen. If that's the case set the Field dropdown to empty.

0 votes
Tejashree Khedekar July 5, 2015

Hi! I am facing the same error. My Jira version is 6.2.2 and Script Runner version is 3.0.16. Still 'Error message' is not displaying against 'Field'. It only gives generic error message. Please help me to get out of this.

0 votes
Marc Jason Mutuc
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.
January 11, 2015

I've made a new comment to add the screenshots. Thanks again Jamie! And I'm really sorry for replying just now.

0 votes
Marc Jason Mutuc
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.
January 11, 2015

Capture.PNG

 

The whole script is '<div font style="color:#f5f5f5;">A</div>Received Submissions' in cfValues['GDS STAGE 3 : MICRO CLEANING']*.value && '<div font style="color:#f5f5f5;">C</div>Preloaded Submissions' in cfValues['GDS STAGE 3 : MICRO CLEANING']*.value && '<div font style="color:#f5f5f5;">E</div>Submissions Loaded' in cfValues['GDS STAGE 3 : MICRO CLEANING']*.value

 

 

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.
January 13, 2015

Your condition looks bogus, seems to be html in it. Maybe copied and pasted from answers or confluence or something?

Marc Jason Mutuc
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.
January 14, 2015

We needed to add color and have some order on the Options of the Checklist. One order on how it is displayed on the Dashboard and One order on when it is being populated or on screen. So That font color hides the 'A' on the Dashboard that decides the order. Option order on the Dashboard is arranged alphabetically. Quite annoying but it makes the higher ups happy.

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.
January 14, 2015

Hrm... I don't think that's a good idea at all. But in that case I would say this is a similar issue to https://jamieechlin.atlassian.net/browse/GRV-588.

Marc Jason Mutuc
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.
January 14, 2015

I tried another one and just chose from the examples and still got the error. Anyway, I'll keep testing and let you know if I found something that might help us solve this. Thanks as always Jamie!

Marc Jason Mutuc
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.
January 20, 2015

Hi Jamie! I've now been able to get the same results with GRV-588. The message is now shown but sitll has the other error messages as well. I think it has something to do with the validation not being done on a step that has no transition screen.

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.
January 9, 2015

Marc - I think you are confusing validators and conditions. In your question title you mention validators, in the description you mention conditions. Conditions can't show an error message... maybe a screenshot of the workflow config might help. There is a jira issue with conditions: https://jamieechlin.atlassian.net/browse/GRV-588

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.
January 9, 2015

 

 

I can't reproduce this problem now, although I thought I was able to previously.

My validator looks like this:

image2015-1-9 11:16:48.png

When I try to resolve not using Won't Fix it looks like this:

image2015-1-9 11:17:57.png

I am using JIRA 6.3.12 and latest script runner. What else do I need to reproduce a problem?

Marc Jason Mutuc
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.
January 11, 2015

Hi Jamie, I couldn't reply with an image so I made a new 'answer'. Sorry for the late reply.

Marc Jason Mutuc
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.
January 11, 2015

We are using JIRA 6.2.7 with Script Runner 2.1.17 and another instance of JIRA 6.2.7 with Script Runner 3.0.7

Horst Krause January 16, 2015

Same problem here. Using JIRA 6.3.12 and SR 3.0.7. Even when using one of the examples instead of getting an validation error on the selected field, we jsut get that generic error message.

0 votes
Michael Roßmann January 8, 2015

Same issue here with JIRA v6.3.12 and Script Runner v3.0.7.

In addition, the error text did not appear related to the specified field but was always centered in the browser window.

Any ideas?

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.
January 8, 2015

I think this is a jira issue, something between 6.3.7 and 6.3.12 iirc. I will try to look into it more later.

Suresh April 9, 2015

Hi Jamie, Did we found solution for this issue. Error message not showing up when condition is true. Thanks, Suresh

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.
April 9, 2015

It's not as simple as that, and the bug you created didn't have nearly enough information for me to do anything with. Try the condition: true Does the error message show up then?

Suresh April 9, 2015

Hi Jamie, I have added condition : true But still error message is not showing up.Can you please help with systax. https://jamieechlin.atlassian.net/browse/GRV-682 Thanks In Adavance Thanks,

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.
April 10, 2015

Can you post a screenshot of the workflow configuration.

Marc Jason Mutuc
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.
April 13, 2015

Hi Jamie - The error occurs when there is no Transition Screen used. Otherwise, error messages are displayed properly.

Suresh April 13, 2015

Yes,Marc it is working fine if add transition and validate field on the screen. Jamie: we have almost 20 transition with out transition screen.To resolve error messages issue, Adding transition screens to transition..it will not make sense to management. Please suggest us to "showing error message". with out transition screens. thanks for you Jamie.

0 votes
Marc Jason Mutuc
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.
December 24, 2014

Just finished testing. Same results.

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.
December 24, 2014

You could try upgrading to SR latest version... it's compatible with 6.2.

0 votes
Marc Jason Mutuc
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.
December 23, 2014

Also tried it with a transition screen. No message shown there either.

0 votes
Marc Jason Mutuc
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.
December 23, 2014

Tried it. Still shows the same generic error message.

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.
December 23, 2014

that second code will only work for single selects or radio buttons, and only the last statement will have an effect. Can you replace your code with just "false", ie make it fail, and see if that gives you the proper message?

0 votes
Marc Jason Mutuc
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.
December 23, 2014

Just to add, the validation (condition && condition && condition) works perfectly. It validates as expected. Its just the error message which is not being shown when the condition is not met.

0 votes
Marc Jason Mutuc
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.
December 23, 2014

Here is the validator code via Simple Scripted Validator: 'ChecklistItem1' in cfValues['ChecklistField']*.value && 'ChecklistItem2' in cfValues['ChecklistField']*.value && 'ChecklistItem3' in cfValues['ChecklistField']*.value I used the following code on another Checklist Field but it does not seem to work for the current Checklist Field I'm working on: cfValues['ChecklistField'][0].getValue() == 'ChecklistItem1' cfValues['ChecklistField'][1].getValue() == 'ChecklistItem2' cfValues['ChecklistField'][2].getValue() == 'ChecklistItem3' Thanks and Merry Christmas!!! :)

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.
December 23, 2014

I would upgrade to Script Runner 3, although don't know if that will help. What is your validator code?

0 votes
Marc Jason Mutuc
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.
December 23, 2014

Using JIRA v6.2.7 & Script Runner 2.1.17

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events