String scan to find a specific word

Originally asked by Chama on 09 January 2023 (original question)


Hi,

I have ADO bugs sync with Jira defects. I need to search the ADO summary (description) and search for a specific word to switch the Jira assignee accordingly. However, I cannot get it to work. Please see the sample below.

def AssigneeSVT = nodeHelper.getUserByEmail(“email1@abc.com”)
def AssigneeSIT = nodeHelper.getUserByEmail(“email2@abc.com”)

def InSummary = replica.summary

if (InSummary.contains(“SVT”)) {
issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email) ?: AssigneeSVT
}

if (InSummary.contains(“SIT”)) {
issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email) ?: AssigneeSIT
}

Above code doesnt work.

Please help.


Answer by Jillani Fazal on 18 January 2023

Hi Chama,

Hope you are doing great.

We tested the above script and it is working for us. Please check again and if you are still having issues, please create a support ticket and we will look into this.

Thank you!