Assing user in ADO

I’m trying to assign a work item in ADO based in the values that came from Jira (Cloud)

the logic is simple,

if replica.assignee.displayName == “Name” {

// assign email “A”

}else {

//assign to email “B”

}

But using “NodeHelper”returned the errror:

“The following NodeHelper methods are not supported in Exalate for ADO Server: getUser, getUserByEmail, getUserByFullName, and getUserByUsername. Please remove its usages from your scripts.”

but the documentation getUserByEmail says it should work

using the direct assignment like

workItem.assignee.email = “email“

returns the error:

“The error occurs because the assignee field expects an IHubUser object, not a plain string (email). To assign a user by email, you should use the nodeHelper.getUserByEmail method, which returns the correct object type.”

After a few more attempts we were able to sync creating a full instance of the assignee:

{

workItem.assignee = replica.assignee.class.newInstance()

workItem.assignee.email = “email@domain"

workItem.assignee.displayName = "Display"

workItem.assignee.username = "username@domain"

}

Hi @Vasco

Please confirm if you were able to resolve this ? or do you want me to check further?

According to me and documentation:

issue.assignee = nodeHelper.getUserByEmail(replica.assignee.email,"project-name")

this should work.

Waiting for your update!

Thanks,

Sonal