Using Power Script to use validator not working

I am evaluating Power Script to be used in our JIRA. As I am following the sample code for validator (comments required) to transition to another workflow, it does not seem to work. There is no comment provided, but the transition still happens. 

How to get this to work?I have set it up for transition in my workflow. I am using SIL 4.0.6 version.

Thank you.

 

3 answers

This widget could not be displayed.

The following sample script worked for me. Are you sure you associated the script as a validator with the intended transition?

==========

/*
Use this script as a workflow transition validator to allow transition only if
a comment has been supplied.
*/

string errorMsg = "You must enter a comment!";
if(!hasInput("comment")) {
  return false, "comment", errorMsg;
}

=========

commentRequired.png

This widget could not be displayed.

Hi Justin,

Thank you for the reply. I have followed the instruction and put the transition as part of the validator.

If you see my workflow below, the 'check_for_comment' transition from 'BACKLOG' to 'IN PROGRESS', I have validator set. I could see from your answer that it works for me. I am trying to figure out what do I miss. Could you please give me some pointers/information?

Thank you.

validator_check.JPG

This widget could not be displayed.

Hi @Junianto Kosasih, I see this question is pretty old. Are you still having problems with this?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

513 views 3 18
Read article

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