General Technical Discussions for Service

Get Involved. Join the Conversation.


    Hamzeh Al Karmi
    Groovy Script Issue
    Topic posted January 7, 2019 by Hamzeh Al KarmiSilver Medal: 2,000+ Points 
    76 Views, 2 Comments
    Groovy Script Issue
    Problem entering a groovy script

    Hello all,

    I have the below script that when pressing validate I got the below error. Can anyone help please?

    if (isAttributeChanged('Assigned To') && AssigneePersonName == 'bala.gupta')
    return StatusCd == 'In Progress-Agent'; 
      if (isAttributeChanged('Assigned To') && AssigneePersonName == 'Lisa Jones')
      return StatusCd == 'In Progress-Senior';
      if (isAttributeChanged('Assigned To') && AssigneePersonName == 'John Dunbar')
          return StatusCd == 'In Progress-Manager';

    Error generated when pressing Validate:

    Error(1,1) : An internal compiler error occurred: org.codehaus.groovy.syntax.RuntimeParserException: Cannot use return statement with an expression on a method that returns void . At [3:1] See the logs for the error stack.



    • Colby Ross

      Where are you defining StatusCD? Or is that supposed to be StatusID?

    • FNU Preksha

      Hi Al,


       hope you were able to resolve this. The StatusCd uses the code rathre than the description of the status. So if you replace each of the status value with the respective code. Then this would work.



      In Progress-Manager status has the code  IN_PROGRESS_MANAGER

      StatusCd == 'IN_PROGRESS_MANAGER'