Issue with sil script validator getInput Routine

Nannette Mori
Contributor
March 3, 2023

power scripts ver 6.820.1

I have a sil validator that checks for an invalid fix version

The error I am receiving "The getInput routine can only be used in validators or some post function"

However my script is a validator that is associated with a transition

Below is my script:

string errormsg = " please update to a valid delivery version"

string [] delivery = getInput(fixVersions);

if(issuetype == "DR){

    if(contains(delivery ' "x" )){

    return false, fixVersions, errormsg;

   }

{

  else{

   return true;

}

1 answer

1 vote
Anna Hryhoruk _Appfire_
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.
March 6, 2023

Hello @Nannette Mori ,

where do you get this error message:  "The getInput routine can only be used in validators or some post function" ? If it`s in the Editor console of the SIL Manager, that`s expected behavior. When you run it from SIL manager it is not applied as validator (even if you have this script somwhere configured as validator) and getInput routine gives you an error. But if you have this error in a different place - just let me know. 

Also to make getInput working fine make sure that a transition screen has been attached to the current transition and that field Fix Version is present on that transition screen. 

In addition, I see some syntax errors in your script, so I`ve fixed those:

 

string errormsg = "please update to a valid delivery version";

string [] delivery = getInput("fixVersions");

if(issueType == "DR") {

if(contains(delivery , "x" )){
return false, fixVersions, errormsg;

}


else{

return true;

}
}

 

Please try it out and let me know how it goes.
Anna

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events