Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Default Jira massage has shown instead workflow validator massage

hello

I wonder if it's a bug or not,

I added workflow validator (Simple scripted validator of ScriptRunner).

The validator works as expected at the "create" step but not at the "resolve". If the script returns a false value the transition will be blocked with the error message I have defined. but at "resolve" stage its return default Jira massage:

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

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

In this to transitions there is no configured screen.

 

Thank you! 

Noaimage.png

2 answers

1 accepted

Hi @Noa Masel ,

 

Welcome to Atlassian Community!

In my understanding, when you opt to use the "Simple scripted validator", you need to add in your code the instructions to display a message explaining the reason that the Validator failed.

See below example from Scriptrunner documentation, where it throws an InvalidInputException exception if the issue has no fix versions during its closure transition. 

import com.opensymphony.workflow.InvalidInputException

if (issue.getResolution() == "Fixed" && ! issue.fixVersions) {
throw new InvalidInputException("fixVersions",
"Fix Version/s is required when specifying Resolution of 'Fixed'")
}

https://scriptrunner.adaptavist.com/latest/jira/tutorials/scripted-validators-tutorial.html#__em_custom_script_require_fix_version_em

Can you include this exception in your validator script and let me know the outcome?

Thank you @Italo Qualisoni [e-Core] 

My script is checking if the custom field SR-type filled while user open SR ticket.

My simple script  is:

cfValues.get("Service Request Type")?.keySet()?.size() == 2image.png

As I wrote, the validator works as expected at the CEREATE transition, but not at the RESOLVE transition (I added the same validator at the resolve transition because sometimes the ticket opened as bug or task instead of SR, and when I move it to SR the ticket already created and validator doesn't work on the other transition, so before I close the ticket I want to validate if the SR-type field is filled...).

As you can see the massage is not part of the script.

Thank you!

Hi @Noa Masel ,

I was mistaken, you need to throw InvalidInputException when using the "Custom script validator".

My guess is that your transition don't have a screen and this might be part of your issue.

As a test, can you create a Screen containing your "Service Request Type" field and associate this screen in your resolve transition? Let me know if does this fix your issue.

I'm not sure if not working with none screen is a bug or expected behavior, I might need to open a ticket to Adaptavist to get their response on that.

Thank you @Italo Qualisoni [e-Core] I'll try and let you know!

Expected.  Not giving the user a reason for the failure is the primary reason we usually avoid using validators.  It just introduces confusion.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Introducing External Collaboration for Confluence

We’re excited to introduce external collaboration for Confluence, now available in early access. It is available to preview for Confluence Cloud Premium and Enterprise customers. (If you're not on ...

239 views 0 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you