How do you do an AND and a XOR in the same condition for a Fast Track Script Listener?

Deleted user January 13, 2015

Hi

I am attempting to create a fast track script listener that will change the status of a job when the following conditions are met:

  • A particular client name is on the ticket (custom Field)
    AND
  • When the issue reporter name is either User 1 OR User 2 OR User 3 or User 4

I am struggling with this and have only managed to come up with the following:

(cfValues['Client']?.value == 'ClientName')&&((issue.reporter.name == ('User1')) xor (issue.reporter.name == ('User2')) xor (issue.reporter.name == ('User3')) xor (issue.reporter.name ==  ('User4')))

 

Every single time I attempt to trigger these conditions the error logs keep reporting the following:

[groovy.canned.utils.ConditionUtils] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script32.groovy: 1: expecting ')', found 'xor' @ line 1, column 94.
== ('ClientName') xor (issue.
                            ^

1 error

 

Any help on this would be greatly appreciated. I believe it is just the way I have the syntax configured.

Thanks

Adam

 

1 answer

1 accepted

1 vote
Answer accepted
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

"Exclusive or" is the caret ( ^ ) symbol - see http://groovy-lang.org/operators.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events