Groovier way to write a line of code

Joel Batac June 9, 2022

Is there a groovier way of writing thiscode?

if(Id.getIssueType().getName() == "Initiative" &&  issue_status != "Closed" && issue_status != "Resolved" && issue_status != "On Hold" && issue_status != "Blocked" && checkNumberofIssueLink > 0) {

I tried writing it like the below but it's not getting the desired result (e.i, it's pulling issue that are either Block or Resolved or Closed.

if(d.getIssueType().getName() == "Initiative" && issue_status !=(['Closed' && 'Resolved' && 'On Hold' && 'Blocked']) && checkNumberofIssueLink > 0) {

1 answer

0 votes
Daniel Kappers June 9, 2022

You can try the code below.


if(d.getIssueType().getName() == "Initiative" && issue_status NOT IN ('Closed', 'Resolved', 'On Hold', 'Blocked') && checkNumberofIssueLink > 0) {


Suggest an answer

Log in or Sign up to answer